On Jun 5, 9:04 am, Andrew <[EMAIL PROTECTED]> wrote: > Maybe a better way of asking this question would be this: > > What's a reasonable memory footprint for each apache child process?
The bulk of memory consumption used by the Apache child processes will be from your own application. Thus, run your application under Django development server, with DEBUG off, and exercise as much functionality as you can to see what the process size grows to. In other words, only you can work this out. On top of your own applications memory consumption will be base overhead from Apache modules. To work that out simple matter of configuring an Apache with the same Apache modules that you expect to use and startup Apache. Then look at initial size of Apache child processes. Again, only you can work this out as we will not know what Apache modules you intend using. Do be mindful that a deficient Python installation, ie., no shared library, not optimised and not stripped can add a more to this overhead (allow up to extra 3MB per process in worst case) so try and find out whether the web hosting company has a decent Python installation for production use. How much more memory will be required for Apache child processes now depends on whether you are going to use prefork or worker MPM. A worker MPM will have more memory overhead due to memory consumption of creating and managing all the threads. You might allow 1MB per process as a rough start. The three amounts above added together will give you a rough value for the Apache child process size. You would then want some amount of buffer on top of that to account for per request overhead. How this extrapolates out to a whole box now depends on whether you intend using prefork or worker MPM. If you use prefork you will have lots more processes and thus overall memory consumption for the box is more. If you use worker MPM then less processes and thus less overall memory use. Some will say that using worker MPM is bad because of concurrency issues on multi processor/core machines, but that isn't really true, as a lot of Apache stuff is still in C code and not GIL constrained and other processes can still use other processors. The Django site I believe still says to use prefork, but no one has ever been able to say why when I have challenged this point. There are lots of people using worker MPM and if worker MPM didn't work then Windows wouldn't be able to be used either and no one says not to use Windows. In other words, recommend using worker MPM over prefork MPM if you have a choice as that will allow you to do more with a more memory constrained box. Anyway, there are a few guidelines so you can work it out for yourself. No one is really going to be able to give you any figures as it really depends on your application and how you want to setup Apache. Also depends on how you setup mod_python as well and whether you can get away with one Python interpreter or need more for some reason. Graham > >From there we can extrapolate request/sec and concurrency to get a > > rough estimate of the total RAM needs. > Obviously if we were buliding our own machine, we'd stock if full of > RAM, but we're evaluating VPS right now, so we're just trying to see > what's feasible. > > On Jun 4, 3:03 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > > > On 6/4/07, Andrew <[EMAIL PROTECTED]> wrote: > > > > What are some ballpark memory figures (memory vs requests/sec or > > > concurrent connections) for people running django on Apache prefork w/ > > >mod_python? Would, say, 150 requests/sec for a 2GB memory allocation > > > seem reasonable? > > > As always: it depends. > > > > I understand that each application is different, and each apache > > > deployment can be tuned for different needs; like I said, I'm just > > > trying to get a ballpark. > > > The problem is that we don't know anything about the setup. Is the > > single physical machine doing Apache/mod_python, a media server and > > your database (and possibly caching as well)? Are any of those running > > on separate machines? What are your MaxClients and > > MaxRequestsPerChild? > > > Which is a roundabout way of reiterating that there is no rule, or > > even rule of thumb, for "X amount of memory will serve X requests per > > second" -- the configuration of Apache, and the other services running > > on the machine (and hence competing for resources) can so drastically > > affect performance and resource consumption that there's simply no way > > to even give a ballpark figure. > > > -- > > "Bureaucrat Conrad, you are technically correct -- the best kind of > > correct." --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---