[wp-trac] [WordPress Trac] #46645: Site health: timeout on the "Info" tab

WordPress Trac noreply at wordpress.org
Tue Mar 26 18:31:32 UTC 2019


#46645: Site health: timeout on the "Info" tab
-------------------------------------------------+------------------------
 Reporter:  azaozz                               |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  5.2
Component:  Administration                       |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  site-health has-patch needs-testing  |     Focuses:  multisite
-------------------------------------------------+------------------------

Comment (by azaozz):

 Testing 46645.diff, it's a very nice speed bump, almost twice as fast :)

 Basic test in PHP 7.3 default build (no additional themes or plugins):
 {{{
 RecursiveDirectoryIterator ABSPATH size 50 times: t = 8.6705460548401,
 size = 50768266
 get_dirsize() ABSPATH size 50 times: t = 4.9799430370331, size = 47831434
 }}}

 The size is different as `filesize( $path )` gets the exact size in bytes,
 `$file->getSize()` when using RecursiveDirectoryIterator seems to get the
 "size on disk", however directory size as reported by the OS is different:

 {{{
 Size:           45.6 MB (47,831,434 bytes)
 Size on disk:   46.7 MB (48,984,064 bytes)
 Contains:       2,162 Files, 256 Folders
 }}}

 However having the Gutenberg source in the plugins dir still gets it to
 time out. This time the fatal is in `\wp-includes\functions.php on line
 6960`. Thinking we'll need to add the "timeout protection" to
 `get_dirsize()`. That will also be useful to multisite as suggested in
 #26135.

 Fixing the cache/transient as in #19879 would also be needed, but is
 somewhat out of scope here.

 IMHO the next steps are:
 - Add a microtime constant at the top of `wp_initial_constants()` so we
 have a more precise "start of running" time and it's not changeable by
 plugins;
 - `get_dirsize()` will need a "sensible default" of how long it's allowed
 to run before giving up. Add another param to it so it's easy to set.

 Patch coming up :)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46645#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list