How to set a HARD memory limit for apache

This is a discussion on How to set a HARD memory limit for apache within the Apache Web Server forums, part of the Web Server and Related Forums category; I have a Linux server that I am configuring for Apache to me used with mod_perl. I want to make ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008
Ignoramus12509
 
Posts: n/a
Default How to set a HARD memory limit for apache

I have a Linux server that I am configuring for Apache to me used with
mod_perl.

I want to make sure that no apache child can, ever, under any
circumstances, exceed some memory size limit such as 300 MB.

I looked at perl modules such as Apache2::Resource and
Apache2::SizeLimit and they would not work for me. The former just
does not do its job, and the second a) just checks memory size and b)
does not work with threaded MPM.

What I want is a very simple thing: I want an apache daemon to
INSTANTLY DIE if it ever reaches size of X such as X = 300 MB. I do
not want to "give them a chance". I also do not want to "check the
size at some times (like in CleanupHandler)". I want behaviour such as
that specified by bash ulimit function. Instant death immediately upon
reaching the limit.

The reason for this is that I do not want a memory consuming bug in my
mod_perl code to damage my server.

At the same time, I would like to set a lower limit that would exit
apache gracefully and that would be checked from, say, a
CleanupHandler.

So, does anyone have any suggestions for what I should use.

Thanks.

i
  #2 (permalink)  
Old 02-29-2008
Joost Diepenmaat
 
Posts: n/a
Default Re: How to set a HARD memory limit for apache

Ignoramus12509 <ignoramus12509@NOSPAM.12509.invalid> writes:

> What I want is a very simple thing: I want an apache daemon to
> INSTANTLY DIE if it ever reaches size of X such as X = 300 MB. I do
> not want to "give them a chance". I also do not want to "check the
> size at some times (like in CleanupHandler)". I want behaviour such as
> that specified by bash ulimit function. Instant death immediately upon
> reaching the limit.


How about just putting a hard ulimit in the apache init.d script?

> At the same time, I would like to set a lower limit that would exit
> apache gracefully and that would be checked from, say, a
> CleanupHandler.


Dunno about that.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
  #3 (permalink)  
Old 02-29-2008
xhoster@gmail.com
 
Posts: n/a
Default Re: How to set a HARD memory limit for apache

Ignoramus12509 <ignoramus12509@NOSPAM.12509.invalid> wrote:
> I have a Linux server that I am configuring for Apache to me used with
> mod_perl.
>
> I want to make sure that no apache child can, ever, under any
> circumstances, exceed some memory size limit such as 300 MB.
>

....
> I want behaviour such as
> that specified by bash ulimit function. Instant death immediately upon
> reaching the limit.


I don't understand the problem. If ulimit does exactly what you want,
why not just use ulimit?

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
  #4 (permalink)  
Old 02-29-2008
Jürgen Exner
 
Posts: n/a
Default Re: How to set a HARD memory limit for apache

Ignoramus12509 <ignoramus12509@NOSPAM.12509.invalid> wrote:
>I have a Linux server that I am configuring for Apache to me used with
>mod_perl.
>
>I want to make sure that no apache child can, ever, under any
>circumstances, exceed some memory size limit such as 300 MB.


I fail to see the relationship between your question and the programming
language uses.

[...]
>So, does anyone have any suggestions for what I should use.


I would suggest to use a newsgroup that deals with Apache and/or your OS of
choice.

jue
  #5 (permalink)  
Old 03-01-2008
The Natural Philosopher
 
Posts: n/a
Default Re: How to set a HARD memory limit for apache

Ignoramus12509 wrote:
> I have a Linux server that I am configuring for Apache to me used with
> mod_perl.
>
> I want to make sure that no apache child can, ever, under any
> circumstances, exceed some memory size limit such as 300 MB.
>
> I looked at perl modules such as Apache2::Resource and
> Apache2::SizeLimit and they would not work for me. The former just
> does not do its job, and the second a) just checks memory size and b)
> does not work with threaded MPM.
>
> What I want is a very simple thing: I want an apache daemon to
> INSTANTLY DIE if it ever reaches size of X such as X = 300 MB. I do
> not want to "give them a chance". I also do not want to "check the
> size at some times (like in CleanupHandler)". I want behaviour such as
> that specified by bash ulimit function. Instant death immediately upon
> reaching the limit.
>
> The reason for this is that I do not want a memory consuming bug in my
> mod_perl code to damage my server.
>
> At the same time, I would like to set a lower limit that would exit
> apache gracefully and that would be checked from, say, a
> CleanupHandler.
>
> So, does anyone have any suggestions for what I should use.
>
> Thanks.
>
> i

Apache source, and a C compiler, and a custrome version of malloc();
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:17 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0