Re: move_uploaded_file and CPU wait state (IO)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Yes, /tmp is on another disk then the final directory. I shall move it to the same disk (tmp_upload_dir) right now.

Question: can I define tmp_upload_dir to be otherwise just for one host in apache conf, like:

php_ini upload_tmp_dir /some/dir

I am not sure that this works for all PHP ini settings?

Will let you know how this works out!

Thank you!

Regards,
Aleks

PS. Did I do sth wrong, or someone tried to unsubscribe using my thread? :)

Curt Zirzow wrote:
On Mon, Feb 27, 2006 at 06:39:13PM +0100, phpmaillist@xxxxxxxxxxx wrote:
Hi,

My first mailing, if I'm in wrong group or such, let me know ;)

Here comes my question. I have implemented file uploads to my server. At the end of upload, file is
beeing moved from /tmp to permanent directory. However, whenever this happens, CPU goes berzerk and
waits for disk to finish moving file. As allowed files may be up to 100 MB per file, having more
then 3 users makes complete server freeze. Meantime, server load reaches skyhigh 40+. After file is
moved, server resumes normal operation, however while moving file server is completely not
responding.

I'm just taking a wild guess at this moment, but usually is a sign
when disk access is an issue and tends to be because it is rather
full excpecially with larger files.

Some questions that i that I would first look at:

  - how much space is on /tmp or the drive you are moving it to
  - is /tmp on the same drive as where ever you are moving it to.
  - if it is the same drive, the move should be quick
- test a move directly on the filesystyem and see how long it takes
Just in case you arn't familiar with disk usage do a:
  du -h

and observe the output.

Is there a work around? I am not so good with linux (yet ^^), so I do not know if there is place
for improvement on OS itself. I asked this question on Debian forum, but am trying here as well.

If someone has same problem and prefferably solution, or even sugestions - all is welcome! :)

Although of what I mentioned really shouldn't explain your 40+ load
unless you are under requests and you are very close to 100% on one
of those disk partitions from 'du'.

2 x 80 GB IDE HDD

Since you have 2 disks i would suggest putting all your logging
information on one disk or the other and reserver the other disk
for accessing pages or uploads.

But then again it really doesn't explain the 40+ server load, you
may have other issues at hand.


Curt.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux