On Oct 25, 9:32 am, Michel Thadeu Sabchuk <[EMAIL PROTECTED]> wrote: > Hi Graham, > > First, thanks for all your help! > > > If a different physical machine or you have multiple IPs on the one > > machine, then preferable to serve the media files from a different > > hostname. That way the media web server can still run on port 80, in > > the case of the same machine by configuring the respective web servers > > to only listen on the one IP address and not all interfaces. > > > If you only have the one machine, don't have a separate IP and don't > > want to have a non port 80 public web server, then you'll need to make > > everything appear on the one hostname/port. > > Well, I have another server available now ;) > > > Do you know which process in particular though are using up all the > > memory? > > The `top` command tells me that apache is taking the most slice of the > RAM. When I reach the high loads, there is between 40-50 subprocess of > httpd. > > > If it is the Apache child process in which mod_python and your Django > > application is running are you taking measures like setting > > MaxRequestsPerThread directive to some non zero value so that the > > processes are recycled on a regular basis and not just growing and > > growing in size over time. Disabling keep alive or at least reducing > > the keep alive timeout can also be help in as much as holding down > > active memory and allowing more concurrent requests from different > > users without Apache having to launch new child processes. > > The KeepAlive is already disabled, I don´t have set > MaxRequestPerThread, whould you suggests me to set it? > > <IfModule prefork.c> > StartServers 5 > MinSpareServers 5 > MaxSpareServers 10 > ServerLimit 1600 > MaxClients 1500 > MaxRequestsPerChild 10000 > </IfModule> > > KeepAlive Off > MaxKeepAliveRequests 100 > KeepAliveTimeout 15 > > > > A friend told me that I can make python library shared. > > > If you track that one back far enough you will find me at the other > > end as I was the one who started that recommendation. I got sick of > > people complaining about mod_python using up so much memory when it > > was mostly to do with the Python installation not using a shared > > library and what happens when statically compiled object gets used in > > dynamically loadable modules. :-) > > :) ok, then I need to compile python with shared libraries and > recompile mod_python to link it with my new python environment? > > > the GIL is not > > necessarily as big a problem when hosting applications embedded with > > Apache child processes as some would have you believe. See my prior > > blog entries for more about GIL and multi core issues: > > > http://blog.dscpl.com.au/2007/09/parallel-python-discussion-and-modws... > > http://blog.dscpl.com.au/2007/07/web-hosting-landscape-and-modwsgi.html > > How to split things up across boxes is always a hard decision. You > > really need to do some testing which mirrors the requirements of your > > application as far as database and media file serving loads to get a > > good idea. Without that it may be more of an educated guess as to > > which may benefit more. > > Well, I made use of locmen cache, this may compromise the ram usage I > think. > > > Still not sure though what you think is causing the problems. Yes, you > > have high memory usage but what is using the memory? Is that leading > > onto swapping? > > Not all the time, once I have 4GB of ram the server don´t go to swap > almost all the time. I can´t tell preciselly if the server is onto > swapping when the server stucks. I will pay attention to this when the > problem occours again. I´m not a server expert, is this top output > normal? > > Cpu(s): 7.5% us, 1.3% sy, 0.0% ni, 91.0% id, 0.0% wa, 0.1% hi, > 0.1% si > > us is the user cpu usage, sy is system ok? What is id? Is it normal to > have it at higher levels?
id is idle. That means the CPU is just sitting in idle state and not doing any processing. > > > If you can indicate whether it is Apache itself, the > > Django application, the database etc, will help as far as giving > > further suggestions. > > I don´t have any performance meter, I thinking on put a script making > a log of a ps command and analyses that result until a crash, do you > recommends me any performance test tool? > > I can´t tell preciselly but I think apache is the bad guy here. > Yesterday, my server start to have problems just after I change a > header file used on partnets sites. The header is an static file, it > seems that when many users start to download the new header (the older > was cached on client), my site start to be slow until stuck. > > > BTW, as far as using mod_python, you might want to also experiment > > with mod_wsgi. For your sort of high performance web site, you would > > most likely use it in embedded mode and so not much different to > > mod_python in that respect, but mod_wsgi does have a smaller memory > > footprint and lower per request overhead. > > I see your posts ;), I can give it a try. But I want to fight the real > problem reather to waste time on something that can help but not solve > my problem. If I use mod_wsgi I need to compile python with shared > libraries too? > > I thinking on set lighttpd on the other server I got and serve the > partners header throught it to see what does happen. Do you know any > performance logging tool I can use to measure if my action solves > anything? > > Graham, thanks for all the help :-P > Best regards! > > -- > Michel Thadeu Sabchuk > MisterApe --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---