tomehb Posted September 29, 2008 Share Posted September 29, 2008 Hi Guys, Basically i would like any PHP process on my Linux server to always have a low process priority(nice 10), just wondering how i would achieve this? Cheers Tom Quote Link to comment https://forums.phpfreaks.com/topic/126278-php-process-priority-on-linux/ Share on other sites More sharing options...
trq Posted September 29, 2008 Share Posted September 29, 2008 Assuming your talking about processes called via apache? The only solution I can see is to have apache itself run nice. Quote Link to comment https://forums.phpfreaks.com/topic/126278-php-process-priority-on-linux/#findComment-652939 Share on other sites More sharing options...
tomehb Posted September 29, 2008 Author Share Posted September 29, 2008 Just created a little script to do it, but there a correct way of doing this?!! moved /usr/bin/php to /usr/local/php.notnice Added php wrapper script as follows: /usr/bin/php #!/bin/bash #Wrapper script to nice the php exe, nice -n 19 /usr/bin/php.notnice $@ Quote Link to comment https://forums.phpfreaks.com/topic/126278-php-process-priority-on-linux/#findComment-653044 Share on other sites More sharing options...
trq Posted September 29, 2008 Share Posted September 29, 2008 Are you trying to manipulate php processes belonging to apache or ones called from the command line? Quote Link to comment https://forums.phpfreaks.com/topic/126278-php-process-priority-on-linux/#findComment-653060 Share on other sites More sharing options...
tomehb Posted September 29, 2008 Author Share Posted September 29, 2008 All, i guess.... Wont this work?? Quote Link to comment https://forums.phpfreaks.com/topic/126278-php-process-priority-on-linux/#findComment-653068 Share on other sites More sharing options...
trq Posted September 29, 2008 Share Posted September 29, 2008 /usr/bin/php is the php cli. A completely different asapi is used by mod php within apache. Quote Link to comment https://forums.phpfreaks.com/topic/126278-php-process-priority-on-linux/#findComment-653083 Share on other sites More sharing options...
tomehb Posted September 30, 2008 Author Share Posted September 30, 2008 and where is this located, explain further please if you may.. Cheers Thomas Quote Link to comment https://forums.phpfreaks.com/topic/126278-php-process-priority-on-linux/#findComment-653681 Share on other sites More sharing options...
trq Posted September 30, 2008 Share Posted September 30, 2008 mod_php is an Apache module. So basically php becomes a part of Apache. What exactly are you looking to do? As far as I'm aware the only options for limiting the resources php consumes via Apache is through the available php.ini directives. Quote Link to comment https://forums.phpfreaks.com/topic/126278-php-process-priority-on-linux/#findComment-653702 Share on other sites More sharing options...
tomehb Posted September 30, 2008 Author Share Posted September 30, 2008 PHP seems to clog up the box, therefore i would like to lower the process priority so that other more important process do not get interrupted.. Understand? Quote Link to comment https://forums.phpfreaks.com/topic/126278-php-process-priority-on-linux/#findComment-653705 Share on other sites More sharing options...
trq Posted September 30, 2008 Share Posted September 30, 2008 Yeah, I understand. See my post above for the solution. Quote Link to comment https://forums.phpfreaks.com/topic/126278-php-process-priority-on-linux/#findComment-653767 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.