TurboGears with SCGI and Visit Tracking

0 views
Skip to first unread message

Joseph Tate

unread,
Jun 9, 2006, 1:56:13 PM6/9/06
to TurboGears
This bit me, and I wanted to post it here so that it can be searchable.

I've been trying to figure out why my visit tracking system didn't seem
to record any visits when run behind the scgi interface. I'm using the
pre-forking scgi server from the scgi module. Of course you looking at
all that information can clearly see the problem of using a threaded
visit tracking module with multiple processes, but it took me a while
to figure that out.

So, if you plan to deploy your turbogears app behind apache or lighttpd
using scgi and rely on the visit tracker or identity modules, either
use a threaded scgi server, or pick a different deployment model. I'd
currently recommend proxying, or for apache, the new and improved mpcp
module soon to be added to cherrypy proper.

Meanwhile, I'm changing my visit model to update the session table
immediately instead of caching for 30 seconds first since I'm not
actually expecting high enough traffic volumes to justify the headache.

In relation to this information, I think the documentation should be
updated to either remove scgi as a deployment option, or some prominent
warning be added.

Joseph

Damjan

unread,
Jun 11, 2006, 11:34:50 PM6/11/06
to TurboGears
> I've been trying to figure out why my visit tracking system didn't seem
> to record any visits when run behind the scgi interface. I'm using the
> pre-forking scgi server from the scgi module. Of course you looking at
> all that information can clearly see the problem of using a threaded
> visit tracking module with multiple processes, but it took me a while
> to figure that out.
>
> So, if you plan to deploy your turbogears app behind apache or lighttpd
> using scgi and rely on the visit tracker or identity modules, either
> use a threaded scgi server, or pick a different deployment model. I'd
> currently recommend proxying, or for apache, the new and improved mpcp
> module soon to be added to cherrypy proper.

If the visit system depends on the Application beeing in a single
process, will it not break in mod_python too? At least on Unix where
the prefork MPM is default (and even worker creates several processes,
I think).

Joseph Tate

unread,
Jun 12, 2006, 1:15:33 PM6/12/06
to TurboGears

Damjan wrote:
>
> If the visit system depends on the Application beeing in a single
> process, will it not break in mod_python too? At least on Unix where
> the prefork MPM is default (and even worker creates several processes,
> I think).

It sure would.

Reply all
Reply to author
Forward
0 new messages