Re: move_uploaded_file and CPU wait state (IO)

From: Date: Mon, 27 Feb 2006 23:38:43 +0000
Subject: Re: move_uploaded_file and CPU wait state (IO)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-231171@lists.php.net to get a copy of this message
My first mailing, if I'm in wrong group or such, let me know ;)
You've come to the right place :)
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.
Is /tmp on a different disk partition to the final directory ? That could explain it - it's like moving a file on your windows machine from c: to d: Can you move the 'upload_tmp_dir' to a new directory on the same partition as the final directory? See 'upload_tmp_dir' in your php.ini file. Don't change your move_uploaded_file call to use rename() and unlink() - you'll run into problems and it bypasses the checks built into move_uploaded_file. -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#231171) next »