LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to Limit suphp user memory limit? (http://www.linuxquestions.org/questions/linux-server-73/how-to-limit-suphp-user-memory-limit-807439/)

Rundi 05-12-2010 02:13 PM

How to Limit suphp user memory limit?
 
I have a VPS server with 512 MB memory. The php.ini is set so script memory limit = 16 MB. However, I have noticed in my top report, instances like the following:

Quote:

5484 coldclim 25 0 46476 32m 5920 R 0.0 6.4 0:00.93 php
The bold number of 6.4 is the % of sever memory this process is using. 6.4 % of 512 MB of memory is about 32 MB of memory, so it appears that this isn't being limited by php.ini. Am I correct?

This leads to the next question: Is there some way to limit the amount of memory a single suphp process can use? (Basically, something like the setting in php.ini which limits suphp processes in the same way.)

Thanks for the help.

centosboy 05-14-2010 03:01 AM

Quote:

Originally Posted by Rundi (Post 3966098)
I have a VPS server with 512 MB memory. The php.ini is set so script memory limit = 16 MB. However, I have noticed in my top report, instances like the following:



The bold number of 6.4 is the % of sever memory this process is using. 6.4 % of 512 MB of memory is about 32 MB of memory, so it appears that this isn't being limited by php.ini. Am I correct?

This leads to the next question: Is there some way to limit the amount of memory a single suphp process can use? (Basically, something like the setting in php.ini which limits suphp processes in the same way.)

Thanks for the help.

AFAIK in the php.ini - limit per script only....but you can do this..

either edit /etc/security/limits.conf or set limit for php user with ulimit, assuming you have access to these, of course

Rundi 05-14-2010 12:27 PM

Thanks for the reply. I do have access to the limits.conf file, but I tried that some time ago, and it didn't seem to work. See:

http://www.linuxquestions.org/questi...orking-795332/

To summarize, "The settings in limits.conf are only applied to normal interactive user logins. These settings don't apply to processes started at boot time, via cron, etc." and I guess the suphp user is started at bootup and thus escapes the limits.conf file. That confounded me, which was why I was hoping suphp itself had some method for limiting users.


All times are GMT -5. The time now is 03:07 AM.