http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess
2012/6/14 Michele Comitini <michele.comit...@gmail.com>: > I would still lower Threads to 5 and use the WSGIDaemonProcess > directive with only processes. > > WSGIDaemonProcess processes=x > > x depends on how much memory you have. since web2py *is* fast you do > not need higher than x = 4*n cpus. > with processes dal db connection can be with poolsize=1. > > > mic > > > 2012/6/14 Massimo Di Pierro <massimo.dipie...@gmail.com>: >> I am switching to nginx as soon as I move the server. Anyway for now I >> disabled apps that are not used (should not be used) and changed the apache >> conf to >> >> Timeout 35 >> KeepAlive On >> MaxKeepAliveRequests 15 >> KeepAliveTimeout 2 >> <IfModule mpm_worker_module> >> StartServers 5 >> MaxClients 10 >> MinSpareThreads 15 >> MaxSpareThreads 15 >> ThreadsPerChild 10 >> MaxRequestsPerChild 50 >> </IfModule> >> >> and the memory exhaustion problem seems to be gone away. At least for now. >> >> massimo >> >> On Thursday, 14 June 2012 05:10:43 UTC-5, mcm wrote: >>> >>> Massimo, >>> >>> do you have any good reason to run apache? if not switch to nginx. >>> >>> mic >>> >>> >>> 2012/6/14 Michele Comitini <michele.comit...@gmail.com>: >>> > Correction: >>> >> mpm_worker -> spawn a number of different long running processes to >>> >> manage requests >>> > mpm_worker -> spawn a number of different long running *threads* to >>> > manage requests >>> > >>> > >>> > 2012/6/14 Michele Comitini <michele.comit...@gmail.com>: >>> >> mpm_prefork -> fork a number of different long running processes to >>> >> manage requests >>> >> mpm_worker -> spawn a number of different long running processes to >>> >> manage requests >>> >> >>> >> wsgi can fork and thread python interpreters so the overall status of >>> >> forking and threading varies a lot because of this. >>> >> An important thing to remember is that if the python interpreter dies >>> >> all threads in the same thread group die. >>> >> If there is a pure threaded only configuration the whole apache server >>> >> can die if python dies. >>> >> >>> >> Switching to prefork could make the site more available, but does hide >>> >> the real problem, i.e. the python interpreter dies for some reason. >>> >> >>> >> N.B. php can work reliably only on prefork configuration, because it >>> >> is not thread safe. >>> >> >>> >> mic >>> >> >>> >> >>> >> 2012/6/14 Massimo Di Pierro <massimo.dipie...@gmail.com>: >>> >>> some follow up. One thing that happened when the problem started is >>> >>> that I >>> >>> was experimenting with the apache settings and turned off keepalive. >>> >>> >>> >>> I do not fully understand the implications of apache settings >>> >>> (mpm_prefork_module vs mpm_worker_module) and their parameters but >>> >>> since >>> >>> Python get slower the more cores are available for a fixed number of >>> >>> threads, there is an optimum set of parameters depending on the >>> >>> architecture. >>> >>> >>> >>> I will continue some experimentation. >>> >>> >>> >>> Massimo >>> >>> >>> >>> >>> >>> On Wednesday, 13 June 2012 17:47:55 UTC-5, Massimo Di Pierro wrote: >>> >>>> >>> >>>> The fact is I did not have that problem before. The number of users >>> >>>> has >>> >>>> not increased much. Either a recent commit changed something (if this >>> >>>> is a >>> >>>> web2py problem) or it is a cache issue (I have many apps and some >>> >>>> cache too >>> >>>> much stuff in ram). >>> >>>> >>> >>>> massimo >>> >>>> >>> >>>> On Wednesday, 13 June 2012 17:38:26 UTC-5, Bruce Wade wrote: >>> >>>>> >>> >>>>> This seems like the same problems I am having with >>> >>>>> new.youadworld.com all >>> >>>>> the resources are getting sucked out of 5 servers. I am starting to >>> >>>>> think I >>> >>>>> will have to start porting some of the sites features to a different >>> >>>>> technology. >>> >>>>> >>> >>>>> This is a bad situation as I have been developing >>> >>>>> www.fittraineronline.com also with web2py however I cannot run into >>> >>>>> the same >>> >>>>> situation with that site, especially when I will have a mobile web >>> >>>>> app also >>> >>>>> with potentially millions of members. >>> >>>>> >>> >>>>> I am going to continue digging through the core and try to optimize >>> >>>>> this >>> >>>>> as the developers productivity is great. However spending around >>> >>>>> $1200 a >>> >>>>> month just to run a site that can't handle 40,000 members isn't >>> >>>>> good. >>> >>>>> >>> >>>>> On Wed, Jun 13, 2012 at 3:31 PM, Massimo Di Pierro >>> >>>>> <massimo.dipie...@gmail.com> wrote: >>> >>>>>> >>> >>>>>> I do not know. Everything worked fine for long time until one week >>> >>>>>> ago I >>> >>>>>> started having problems with the server. The fact is nothing >>> >>>>>> changed in >>> >>>>>> web2py to be causing this. I am still debugging but not much info >>> >>>>>> to look >>> >>>>>> at. I have lots of apps running on the same server and I am >>> >>>>>> planning to do a >>> >>>>>> major cleanup so we can have mirrors. >>> >>>>>> >>> >>>>>> Massimo >>> >>>>>> >>> >>>>>> On Wednesday, 13 June 2012 16:13:25 UTC-5, JavierQQ wrote: >>> >>>>>>> >>> >>>>>>> >>> >>>>>>> On Wed, Jun 13, 2012 at 4:08 PM, davidjensen wrote: >>> >>>>>>>> >>> >>>>>>>> cannot establish connection to www.web2py.com >>> >>>>>>>> 2012-06-13T17:11 >>> >>>>>>> >>> >>>>>>> >>> >>>>>>> Me too :( >>> >>>>>>> why is this happening constantly? >>> >>>>>>> >>> >>>>>>> Javier >>> >>>>> >>> >>>>> >>> >>>>> >>> >>>>> >>> >>>>> -- >>> >>>>> -- >>> >>>>> Regards, >>> >>>>> Bruce Wade >>> >>>>> http://ca.linkedin.com/in/brucelwade >>> >>>>> http://www.wadecybertech.com >>> >>>>> http://www.fittraineronline.com - Fitness Personal Trainers Online >>> >>>>> http://www.warplydesigned.com >>> >>>>> >>> >>>