in reply to Re^2: CgiProxy And Heavy Visitors
in thread CgiProxy And Heavy Visitors
You haven't been very specific on exactly how many different scripts you're running, or what those scripts are doing that might require them to use so much memory. That information could result in a significantly different recommendation.
Without knowing just what's going on, I have no idea if 4GB is enough ... or what even qualifies as 'enough'. Making sure it's not going to be paging under its current load is one thing, but I'm guessing your company won't be happy if you creep back up over the line before the year's out. (and I'm guessing you will, with any significant growth, given that you're restarting mod_perl every 10 minutes.)
I'd suggest that you do more than just throw memory at the problem, and try to determine what the real problem is. I remember once being rushed to the emergency room, and after many hours there, being released and told to take a pain killer, because they had no idea what was wrong. (it took another 18 months and 3 different doctors, after a whole bunch of other medical problems before I figured out on my own that I had become lactose intolerent). If I had listened to the 'professionals', who had a vested interest in my coming back more times and giving blood samples and the like, (as they'd stop getting money if I didn't keep showing up), I'd probably be miserable to this day, as it felt like my innards were ripping itself apart, and couldn't travel without... let's just say 'many unpleasent problems', that we'll compare to your restarting every 10 minutes.
No one has been given enough information to make an authoritative recommendation to solve your problem with anything more than a band-aid to stabalize it so that you can do some more in-depth analysis to find the real problem. Writing software can be an interative process, and as you find problems, they can be fixed, or as the parameters change (in your case, the number of hits per minute), the program may have to be changed to deal with conditions that it wasn't expecting when initially written.
The problem with mod_perl is that the program is left running through many, many callings. If you put a program with a memory leak under mod_perl, it will leak with every calling, until it occupies all of the physical memory on the system, and starts paging. It's also possible that you just a lot of different programs on your system, and they call many varied modules, and some may use a fair amount of memory, so that as the apache child processes run each of the scripts, they use more memory (not necessarily a leak, just not a candidate to be using mod_perl)
Without having seen your configuration, or knowing anything other than what you have said, I will state that I do not believe that placing more memory in the server will be a long term fix. Just like putting more oil into a car that's leaking only helps for so long, you're very likely to run into this same problem in the future.
I bitched at BrainBench for their 'Webserver Administrator' test, because they had questions where they gave limited details and asked 'what is sure to fix the problem', and gave solutions like 'adding more memory', 'use RAID', and the like ... this is a similar situation. There is no silver bullet fix to every situation, and there are too many unknowns to assure you that any given solution will fix the problem.
|
|---|