Re: [PHP] move_uploaded_file and CPU wait state (IO)
Hi, I have changed the directory to the same disk. Results are _much_ better! So nothing to blame on PHP, only my lack of knowledge about *nix-like system *blush* Thank all for the advice and help! Cheers, Aleks PS. defining of php_value in virtual host of apache did not work, so I changed php.ini value. Chris wrote: Aleksandar Skodric wrote: 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 snip I'm guessing not, but the php docs will tell you for sure - http://www.php.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] move_uploaded_file and CPU wait state (IO)
Aleksandar Skodric wrote: Hi, I have changed the directory to the same disk. Results are _much_ better! So nothing to blame on PHP, only my lack of knowledge about *nix-like system *blush* Thank all for the advice and help! It's not *nix systems - it's all operating systems. When you move a file between partitions it has to copy the whole file then remove it from the original place when it has verified it has copied ok. PS. defining of php_value in virtual host of apache did not work, so I changed php.ini value. Figured as much :) Chris wrote: Aleksandar Skodric wrote: 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 snip I'm guessing not, but the php docs will tell you for sure - http://www.php.net -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] move_uploaded_file and CPU wait state (IO)
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, [EMAIL PROTECTED] 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
Re: [PHP] move_uploaded_file and CPU wait state (IO)
Aleksandar Skodric wrote: 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 snip I'm guessing not, but the php docs will tell you for sure - http://www.php.net -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] move_uploaded_file and CPU wait state (IO)
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. 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! :) Server P4 2.0 512 MB RAM (will be 2 GB by the end of the week) 2 x 80 GB IDE HDD Thank you! Regards, Aleksandar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] move_uploaded_file and CPU wait state (IO)
Are you sure its the move_uploaded_file() function that is causing the delay? It could be the actual upload of the file itself. If it is the function causing the delay than try the rename() function instead. Also, I have used the copy() and unlink() functions and they work fast. Aaron On 2/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] 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. 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! :) Server P4 2.0 512 MB RAM (will be 2 GB by the end of the week) 2 x 80 GB IDE HDD Thank you! Regards, Aleksandar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- + | Aaron Koning | Information Technologist | Prince George, BC, Canada. + | http://datashare.gis.unbc.ca/fist/ | http://datashare.gis.unbc.ca/gctp-js/ +
Re: [PHP] move_uploaded_file and CPU wait state (IO)
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/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] move_uploaded_file and CPU wait state (IO)
On Mon, Feb 27, 2006 at 06:39:13PM +0100, [EMAIL PROTECTED] 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. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] move_uploaded_file and CPU wait state (IO) - unsubscribe
On Tue, Feb 28, 2006 at 09:43:30AM +0800, stone.wang wrote: unsubscribe unsubscribe unsubscribe unsubscribe unsubscribe unsubscribe unsubscribe unsubscribe unsubscribe unsubscribe unsubscribe unsubscribe unsubscribe unsubscribe dont send to me Since you hijacked my thread, to spam this nonsense? i will be sure to send to you now. Look at the bottom of this message to learn how to unsubscribe. Or view your headers to see how to unsubscribe or perhaps visit: http://php.net/unsub.php And in the future, if you aren't sure how to unsubscribe to a mailing list: 1) dont subscribe to it 2) dont be stupid and send 15 lines of unsubscribe I've officially recorded this nonsense for future reference. Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] move_uploaded_file and CPU wait state (IO) - unsubscribe
On Tue, Feb 28, 2006 at 11:08:30AM +0800, stone.wang wrote: No usa to it http://php.net/unsub.php Yes fondu no be http://php.net/unsub.php i do more If english isn't your first language try to explain that you are not clear how to remove yourself from the list, otherwise try emailing: [EMAIL PROTECTED] to remove yourself. Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php