2008/9/4 Joe <[EMAIL PROTECTED]>: > > Brett Hoerner wrote: >> On Wed, Sep 3, 2008 at 6:59 PM, Joe <[EMAIL PROTECTED]> wrote: >> >>> I've just converted a PHP (Apache 2.2 mod_php5) application first to >>> Python CGI and then to mod_wsgi, so I decided to benchmark some 40-odd >>> representative pages because I wasn't very impressed by the observed >>> performance. >>> >> >> Can you please post the relevant parts of your Apache configuration, >> especially under mod_wsgi? It really, really can affect any sort of >> benchmarks if you're "doin' it wrong". >> > > Sorry, I meant to do that, but I hit Send before I remembered. > > There's really not much to it: > > LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so > > (This is mod_wsgi 2.1-2 from Debian) > > # CGI testing > Alias /static/ "/var/www/pycgi/static/" > ScriptAlias /fccgi/ "/var/www/pycgi/" > AddHandler cgi-script .py > > # mod_wsgi testing > WSGIScriptAlias /fcwsgi /var/www/pywsgi/fcdir.wsgi
Which indicates one script for all URLs. I am presuming you had one script for each URL with PHP rather than doing dispatching within PHP. As I said before, Apache/mod_wsgi can still do the dispatching for you, like with PHP, and it is usually going to be quicker than you doing it yourself. > There was a WSGIReloadMechanism Module while I was converting but I > removed it for the tests. The default for WSGIReloadMechanism in embedded mode is 'Module' so setting it explicitly wouldn't have made a difference and reloading is still on. Having it on shouldn't affect the performance to any noticeable degree anyway. Now, what does you actual WSGI application script contain. If worried that code doing work cant be shown, at least indicate how you are doing main dispatching from application entry point and stuff out the handler function code. Maybe leave one representative handler function in there though. Graham --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to modwsgi@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---