[wpmu-trac] [WordPress MU Trac] #1175: get_dirsize() is causing file upload time outs and dashboards slowdowns
WordPress MU Trac
wpmu-trac at lists.automattic.com
Fri Dec 11 06:12:19 UTC 2009
#1175: get_dirsize() is causing file upload time outs and dashboards slowdowns
----------------------------+-----------------------------------------------
Reporter: brianlayman | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone:
Component: Administration | Version: 2.8.2
Severity: normal | Keywords: slow,dashboard,file,upload,get_dirsize
----------------------------+-----------------------------------------------
In our configuration, we have blogs with large numbers of uploaded files.
We've many authors for some blogs and a number of years worth of their
uploads. One of our blogs has 170K uploaded files.
We'd removed the quota stats section from the dashboard when we found it
was causing the dashboard to take a minute or more to load on some blogs.
Eventually, uploads started behaving the same way. Taking incredibly long
for the smallest files and timing out for anything of moderate size.
I tracked it down to get_dirsize()
The tiny file I was uploading was taking 36.65015 seconds from beginning
to end of wp_handle_upload. I made one change and it took the time down to
0.00601 seconds.
I changed get_dirsize() to:
function get_dirsize($dir) {
return 1;
}
Admittedly we are an outside case with crazy numbers of files, but this
has to be affecting others to lesser degrees too. Constantly scaling the
directory structures calling filesize() for every file, recursing into
each sub-directory, is just not scalable.
--
Ticket URL: <http://trac.mu.wordpress.org/ticket/1175>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser
More information about the wpmu-trac
mailing list