abdul202 Posted April 16, 2013 Share Posted April 16, 2013 i have a script that i use to upload files to file sharing website, recently i got a notice from my hosting provider about the cpu resources the script use about 90% of the cpu the problem is in the following code which consume alot of cpu exec ('' . $php_path . ' -c ' . $config_ini . ' mirrors/rapidshare.php ' . $file_uid . ' ' . $status . ' >/dev/null &'); i use the function exec for processing the code i want to find away to limit the cpu usage for the script best rgards Link to comment https://forums.phpfreaks.com/topic/277008-how-to-limit-the-cpu-usage-for-a-script/ Share on other sites More sharing options...
trq Posted April 16, 2013 Share Posted April 16, 2013 See: http://linux.die.net/man/1/nice Link to comment https://forums.phpfreaks.com/topic/277008-how-to-limit-the-cpu-usage-for-a-script/#findComment-1425063 Share on other sites More sharing options...
abdul202 Posted April 17, 2013 Author Share Posted April 17, 2013 See: http://linux.die.net/man/1/nice Thank you trq this is what i was looking for i found the following tutorial is helpful too on the subject http://www.nixtutor.com/linux/changing-priority-on-linux-processes/ best regards Link to comment https://forums.phpfreaks.com/topic/277008-how-to-limit-the-cpu-usage-for-a-script/#findComment-1425296 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.