On 28-11-2008, Graham Dumpleton wrote:
>
> 2008/11/29 William Dode <[EMAIL PROTECTED]>:
>>
>> Hi,
>>
>> i've a little virtual server with few websites with very low traffics
>> and one website with more traffic (100000 hits/day). Most of the time it
>> works very very well, very fast, without using too much memory...
>>
>> But sometimes the load goes very high, i don't know why, i imagine that
>> it's because of somes web spiders or attack or a bug in my application.
>>
>> I would like somes tips to configure apache to can handle this problem.
>>
>> I use apache-worker and mod_wsgi in deamon mode.
>>
>> For the mod_wsgi app i use threads=1 (my app is not thread safe) and max
>> request=1000 (for memory leak)
>
> Can you post all the WSGI related directives you have in your Apache
> configuration so can see exactly what you have an whether it is
> correct.
WSGIDaemonProcess seps.flibuste.net user=seps group=www-user
stack-size=524288 python-path=/home/web/seps/pynclude:/home/web/seps/seps.
flibuste.net/pynclude home=/home/web/seps threads=1 inactivity-timeout=600
maximum-requests=1000 display-name=wsgi-seps.flibuste.net
WSGIProcessGroup seps.flibuste.net
AddHandler wsgi-script .wsgi
>
>> for apache i did this : BUT DON'T THINK IT'S CORRECT
>
> For your size site (approx 1-2 request/sec average) you could have
> just left default Apache worker configuration as is and the site would
> probably have worked fine. I wish people would stop trying to
> prematurely optimise performance when it isn't necessary, especially
> when they don't really understand Apache configuration and are likely
> to do more harm than good. :-(
I would not touch the configuration if i had not the problem before of
course !
>
> The thing that is more likely to kill you is your application not
> being thread safe, although depends on how you have setup WSGI
> directives, which you didn't supply. So, post the WSGI bits of the
> configuration and would then be able to comment more.
>
> Also indicate what the WSGI application is written in. Ie., which framework.
My own framework, very light and fast, i use now webob, postgresql with
no orm, caching a lot...
This application was working fine for years, the problem came after an
upgrade to lenny (apache2-modwsgi), before i used
apache1+mod_proxy+twistedmatrix. I measure each page on the app side,
the average is 0.04s it's why i didn't bother to make it thread safe.
thx
--
William Dodé - http://flibuste.net
Informaticien Indépendant
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---