[wp-trac] [WordPress Trac] #19879: Better caching for get_dirsize

WordPress Trac noreply at wordpress.org
Wed Sep 30 05:50:13 UTC 2020


#19879: Better caching for get_dirsize
-------------------------------------------------+-------------------------
 Reporter:  batmoo                               |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:
Component:  Filesystem API                       |     Version:  3.3.1
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback needs-unit-   |     Focuses:  multisite,
  tests                                          |  performance
-------------------------------------------------+-------------------------

Comment (by janthiel):

 Just FYI on how much this has an impact on the file upload:

 Currently on a huge site on NFS with 25G of files the Quota processing
 would take >30 seconds(!) to calculate the whole site. This time is
 required for each upload to finish besides the actual upload processing.
 Calculating only the one required folder would reduce this to <1s.

 Here are some basic stats using Unix file system tools. The actual PHP
 quota calculation will be even worse.

 -bash-4.2$ cd wp-content/uploads/sites/25/
 -bash-4.2$ time du -sh ./
 25G     ./

 real    0m31.757s
 user    0m0.522s
 sys     0m7.391s

 -bash-4.2$ cd wp-content/uploads/sites/25/2020/09/
 -bash-4.2$ time du -sh ./
 7,9G    ./

 real    0m0.898s
 user    0m0.068s
 sys     0m0.250s

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


More information about the wp-trac mailing list