|
Home > Archive > Apache Server configuration support > July 2006 > Limiting sessions
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Michael Satterwhite 2006-07-28, 7:22 pm |
| We have a website using PHP. We've been experiencing periods where the site
slows down to a crawl - unacceptably slow. We just ran a trace of what what
happening, and I found that we were essentially using all of memory and
most of the processes active at the time were php.
Although I'm open to suggestions, my first inclination is to find a way to
limit the number of php sessions that apache will start at once. Googling
seems to indicate this is possible, but I couldn't find anything to tell me
how.
Would one of you experts be so kind as to help out here? If there's another
direction we should be looking or more data we should gather, I'm open.
Thanks in advance
---Michael
| |
|
| On Fri, 28 Jul 2006 20:10:49 +0000, Michael Satterwhite wrote:
> We have a website using PHP. We've been experiencing periods where the site
> slows down to a crawl - unacceptably slow. We just ran a trace of what what
> happening, and I found that we were essentially using all of memory and
> most of the processes active at the time were php.
>
> Although I'm open to suggestions, my first inclination is to find a way to
> limit the number of php sessions that apache will start at once. Googling
> seems to indicate this is possible, but I couldn't find anything to tell me
> how.
>
> Would one of you experts be so kind as to help out here? If there's another
> direction we should be looking or more data we should gather, I'm open.
>
> Thanks in advance
> ---Michael
Are you using a shared server?? If so, get a dedicated one! Sorry for the
sort of sideways advice (:
Steve
| |
|
| "Michael Satterwhite" <satterwh.X$NO$S$PAM@weblore.com> schreef in bericht
news:dbuyg.24681$Cn6.16805@tornado.texas.rr.com...
> We have a website using PHP.
Apache assumed, yet version and OS unkown.
> We've been experiencing periods where the site
> slows down to a crawl - unacceptably slow. We just ran a trace of what
what
> happening, and I found that we were essentially using all of memory and
> most of the processes active at the time were php.
Do you have scripts resizing, blurring or otherwise manipulating images
using some GDlibrary?
Accumulated memory consumption is known to happen with mod_php IF the
GDimage object is not destroyed before the scripts end:
http://nl2.php.net/manual/en/function.imagedestroy.php.
However, the memory freed will not be returned to the OS
http://www.php.net/manual/en/functi...d-terminate.php
You might keep the server more alive by checking (inside the scripts the)
memory consumption by memory_get_usage and invoke apache-child-terminate if
usage exceeds a limit you set
http://nl2.php.net/manual/en/functi...y-get-usage.php
> Although I'm open to suggestions, my first inclination is to find a way
> to limit the number of php sessions that apache will start at once.
> Googling seems to indicate this is possible, but I couldn't find
> anything to tell me how.
Perhaps maxrequestsperchild may help you out.
http://httpd.apache.org/docs/2.0/mo...equestsperchild
If memory usage is accumulating -for any reason-, you'll reset the chain
after a given number of requests
Further rlimitmem may help terminating memory hungry cgi-style scripts
before eating it all
http://httpd.apache.org/docs/2.2/mo....html#rlimitmem
AFAIK it does not take into account the shared memory used by modules, like
mod_php.
Finally, if it does not slow down within 24h. Check your daily log rotation
or change to a daily schedule: restarting Apache will free all memory hogged
during the last 24h too.
HansH
|
|
|
|
|