Re: Mod_Perl and MaxRequestsPerChild

2007-10-21 Thread Ask Bjørn Hansen
On Oct 17, 2007, at 2:40 PM, Mark Maunder wrote: So I'm sticking with prefork. Also, my requests average around 2937 B/request which means they're serviced very quickly even for slow clients, so I think I can get away without implementing a proxy accelerator for now, but something I'll keep ree

Re: Mod_Perl and MaxRequestsPerChild

2007-10-18 Thread bharanee rathna
Although mod_proxy is a nice module with many features, I would recommend something like pound doing the proxying & load balancing. It's more light and faster, plus you have the added advantage of keeping your webservers in a local network. If you want something with more features lookup squid,

Re: Mod_Perl and MaxRequestsPerChild

2007-10-18 Thread Jozef Kosoru
On Wed, Oct 17, 2007 at 15:03:46 -0400, Perrin Harkins wrote: > On 10/16/07, Mark Maunder <[EMAIL PROTECTED]> wrote: > > This server has no proxy in front of it and only serves mod_perl > > requests. Static content is loaded from another server with a > > different hostname. > > Even so, if you ru

Re: Mod_Perl and MaxRequestsPerChild

2007-10-17 Thread Mark Maunder
You're right. I just tried an equivalent config with the worker mpm with 1 process with 50 threads, no keepalive enabled and I tried a range for PerlInterpMax (and associated vars) and couldn't get a config I liked. Either there weren't enough interpreters and threads were stuck waiting for an inte

Re: Mod_Perl and MaxRequestsPerChild

2007-10-17 Thread Michael Peters
Perrin Harkins wrote: > On 10/17/07, Mark Maunder <[EMAIL PROTECTED]> wrote: >> Assuming threaded and prefork work equally well in my config, doesn't >> it therefore make sense to run a threaded MPM with a small interpreter >> pool instead of running prefork with a reverse proxy? > > Well, you're

Re: Mod_Perl and MaxRequestsPerChild

2007-10-17 Thread Perrin Harkins
On 10/17/07, Mark Maunder <[EMAIL PROTECTED]> wrote: > Assuming threaded and prefork work equally well in my config, doesn't > it therefore make sense to run a threaded MPM with a small interpreter > pool instead of running prefork with a reverse proxy? Well, you're going to use more memory with t

Re: Mod_Perl and MaxRequestsPerChild

2007-10-17 Thread Mark Maunder
I had no idea practical mod_perl was online - that's really cool! Assuming threaded and prefork work equally well in my config, doesn't it therefore make sense to run a threaded MPM with a small interpreter pool instead of running prefork with a reverse proxy? With prefork with a proxy it seems y

Re: Mod_Perl and MaxRequestsPerChild

2007-10-17 Thread Perrin Harkins
On 10/16/07, Mark Maunder <[EMAIL PROTECTED]> wrote: > This server has no proxy in front of it and only serves mod_perl > requests. Static content is loaded from another server with a > different hostname. Even so, if you run prefork, you need a proxy server. The reason is explained in detail her

Re: Mod_Perl and MaxRequestsPerChild

2007-10-17 Thread Clinton Gormley
On Tue, 2007-10-16 at 15:08 -0400, Perrin Harkins wrote: > On 10/16/07, Clinton Gormley <[EMAIL PROTECTED]> wrote: > > Unless you have a really good reason to use worker, on linux, the > > recommended MPM is worker. > > I'm sure you meant to say prefork there. Ahhh - the old "replying after a

Re: Mod_Perl and MaxRequestsPerChild

2007-10-16 Thread Mark Maunder
This server has no proxy in front of it and only serves mod_perl requests. Static content is loaded from another server with a different hostname. I had keepalive enabled with a 2 second timeout on this server until a few seconds ago. Now before you rake me over the coals, I _thought_ that when I d

Re: Mod_Perl and MaxRequestsPerChild

2007-10-16 Thread Perrin Harkins
On 10/16/07, Mark Maunder <[EMAIL PROTECTED]> wrote: > Mornings are the busiest for us, so the following is not during peak. > This is my current mod_status: > 39.4 requests/sec - 114.4 kB/second - 2976 B/request > 80 requests currently being processed, 170 idle workers Do you have a proxy server

Re: Mod_Perl and MaxRequestsPerChild

2007-10-16 Thread Perrin Harkins
On 10/16/07, Mark Maunder <[EMAIL PROTECTED]> wrote: > I've benchmarked sqlite and it's a lot slower than my home rolled > routines - mostly because of the intensive read/write/update/delete > activity. SQLite is a typically slower than MySQL if you run the MySQL server on the same host (so it can

Re: Mod_Perl and MaxRequestsPerChild

2007-10-16 Thread Mark Maunder
Hi Perrin, Thanks so much for the quick reply. I've commented your original email below: On 10/16/07, Perrin Harkins <[EMAIL PROTECTED]> wrote: > On 10/16/07, Mark Maunder <[EMAIL PROTECTED]> wrote: > > My mod_perl app works with some fairly > > large data structures and AFAIK perl doesn't like t

Re: Mod_Perl and MaxRequestsPerChild

2007-10-16 Thread Mark Maunder
Thanks Michael, All my modules are in startup.pl. I've moved away from mysql because it was too slow for my purposes and I have the equivalent of thousands of small tables. So I'm using my own file access methods with flock() with read/write locking. It's very fast, but the down side is I need to

Re: Mod_Perl and MaxRequestsPerChild

2007-10-16 Thread Michael Peters
Boysenberry Payne wrote: > $Apache2::SizeLimit::MAX_UNSHARED_SIZE = 5; The key here is your unshared memory. On Linux COW takes care of all the stuff you pre-load and then don't change on prefork. But if you're constantly changing large data structures, then prefork won't really work for you

Re: Mod_Perl and MaxRequestsPerChild

2007-10-16 Thread Boysenberry Payne
I use in my start.pl: use Apache2::SizeLimit (); $Apache2::SizeLimit::CHECK_EVERY_N_REQUESTS = 5; $Apache2::SizeLimit::MAX_UNSHARED_SIZE = 5; It might allow you to use prefork MPM without worrying so much about too much memory being taken. -bop On Oct 16, 2007, at 2:39 PM, Mark Maunde

Re: Mod_Perl and MaxRequestsPerChild

2007-10-16 Thread Perrin Harkins
On 10/16/07, Mark Maunder <[EMAIL PROTECTED]> wrote: > My mod_perl app works with some fairly > large data structures and AFAIK perl doesn't like to free memory back > to the OS once it's allocated it, so the processes tend to grow for > the first few hours of the server being up and then the plate

Re: Mod_Perl and MaxRequestsPerChild

2007-10-16 Thread Mark Maunder
Also, just some additional data for the archives and discussion: It seems (in my case) that prefork is much more memory hungry than worker. Here are the details: I switched to a prefork model from worker MPM. As I mentioned before my load avg seemed to drop, but memory usage went up. It continued

Re: Mod_Perl and MaxRequestsPerChild

2007-10-16 Thread Mark Maunder
Thanks guys. I assumed worker would save me memory because threads are light(er)weight. I'm busy trying prefork now and my load avg seems to have dropped slightly, but my memory usage seems to have gone up somewhat. Just read your comments in the archives on copy-on-write Perrin - I had no idea it

Re: Mod_Perl and MaxRequestsPerChild

2007-10-16 Thread Perrin Harkins
On 10/16/07, Clinton Gormley <[EMAIL PROTECTED]> wrote: > Unless you have a really good reason to use worker, on linux, the > recommended MPM is worker. I'm sure you meant to say prefork there. And I agree, if you're concerned about memory, don't use threads. Prefork will save you memory because

Re: Mod_Perl and MaxRequestsPerChild

2007-10-16 Thread Clinton Gormley
Hi Mark I don't know what the issue is, but do you really need to use threads? Why not just use the prefork MPM? It is more efficient than the worker MPM on linux, and may ("may" being a complete guess) be the source of your troubles. Unless you have a really good reason to use worker, on linux,

Mod_Perl and MaxRequestsPerChild

2007-10-16 Thread Mark Maunder
Hi All, I have a high traffic mod_perl2 web server (40 requests/second and all are dynamic data - no images or static html) and I have a slow memory leak in mod_perl2. I haven't tracked the leak down yet, but to deal with it I have set MaxRequestsPerChild to 5000. I'm using the worker MPM with the