Re: [Modeling-users] Database Connections
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2004-08-06 19:33:47
|
Duncan McGreggor <py...@ad...> wrote: [snipped] > We've been running a default mod_python apache configuration: 1 main proc= ess, > and multiple child processes are spawned as needed. I don't and have never > programmed in threads and don't really understand it, so you'll have to > forgive my terminology, if incorrect... >=20 > I guess we could setup mod_python to run a single interpreter > (http://www.modpython.org/live/current/doc-html/dir-other-pi.html), I wou= ld > want to do that only if we had to though... I think we would loose many o= f the > performance gains our client sought by going with mod_python in the first > place... >=20 I do not think so, because requests can be handled concurrently within a single interpreter. And that's what I believe it is done --quoted from http://www.modpython.org/live/current/doc-html/pyapi-interps.html: Default behaviour is to name interpreters using the Apache virtual server name (ServerName directive). This means that all scripts in the same virtual server execute in the same subinterpreter, but scripts in different virtual servers execute in different subinterpreters with completely separate namespaces I've not played a lot with mod_python (just a few hours, in fact), but AFAIK this means that a given application will always be served by the same interpreter. And in such a configuration: - the ECSessioning works, - so each session will get its own EC, - you'll basically get one connection to the database for all. Now, this can be fine... or not, depending on the type of application you're currently building (I mean, its characteristics, esp. if you can expect heavy load). For example, say that some of fetches can take some time --can you wait for a fetch to be finished before serving others? If your app. does not fetch a lot, maybe it's not a pb, but if most of its requests end up with one or more ec.fetch() then the default behaviour will probably not be suitable. And again, could you be more explicit whether in your first mail you meant that "for each session's EC there exists one and only one connection to the db"?? -- S=E9bastien. |