[mod_python] Storing large amounts of data in RAM

Graham Dumpleton graham.dumpleton at gmail.com
Wed Oct 24 00:33:27 EDT 2007


On 24/10/2007, Aaron Gallagher <habnabit at gmail.com> wrote:
> On Oct 23, 2007, at 9:14 PM, Graham Dumpleton wrote:
>
> > If you really need everything to be done in one process, one option is
> > to run a backend Python server process which embeds an XML-RPC server
> > and have all your web interfaces use XML-RPC requests to the game
> > engine in that to do things.
> >
> > Another option is to not use mod_python, instead base your web
> > application on a framework capable of being hosted on any WSGI server.
> > Then run this in standalone Python server process and use Apache to
> > proxy to it.
> >
> > Basing it on a WSGI server, you could also then use daemon mode of
> > mod_wsgi but run with a single managed process. That way you don't
> > have the hassle of having to work out how to run up the backend
> > process as Apache will manage that for you.
> >
> > For further information on data sharing issues in relation to
> > process/threading model of Apache see:
> >
> >   http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading
> >
> > This talks about it in the context of mod_wsgi, but is more up to date
> > and accurate than older version of document I did for mod_python.
>
> I think either of those solutions sounds good. I'm leaning toward the
> WSGI option, because then I don't have to have a backend. I've never
> done anything with mod_wsgi before, so do you have a good all-
> inclusive tutorial for WSGI work with python?

Not on WSGI programming as such, as there is enough of that out there
by other people. For some pointers see:

  http://www.wsgi.org

For mod_wsgi specific material see:

  http://www.modwsgi.org

You just need to work out what WSGI capable framework you might want
to use. One lightweight option is web.py if you need to be doing a lot
of customised pages and request handlers. For a more structure system
have a look at Django. In between you have Pylons, which aims to be a
more componentised system where you can mix and match stuff.

Graham


More information about the Mod_python mailing list