LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-12-2010, 02:13 PM   #1
Rundi
Member
 
Registered: Jun 2003
Location: USA
Distribution: Ubuntu
Posts: 169

Rep: Reputation: 30
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.
 
Old 05-14-2010, 03:01 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by Rundi View Post
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
 
Old 05-14-2010, 12:27 PM   #3
Rundi
Member
 
Registered: Jun 2003
Location: USA
Distribution: Ubuntu
Posts: 169

Original Poster
Rep: Reputation: 30
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate soft limit & hard limit for quotas kennyghh SUSE / openSUSE 4 03-03-2011 12:49 PM
Limit memory usage vinaytp Linux - Newbie 1 11-30-2009 11:45 PM
Limit Bandwidth as Data Volume Approaches Limit sweno Linux - Server 1 06-12-2008 07:10 AM
linux memory limit? rex67 Linux - General 9 01-08-2005 03:36 AM
Quota issue, hard limit doesn't limit users Gratz Linux - Software 2 09-16-2003 07:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration