Re: Question about mod_fastcgi with exclusive session affinity
Tim Wood <timwood0-yBeKhBN/[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <5.2.1.1.1.20041027135209.02066e68@mailhost> |
At 09:00 AM 10/27/04, [email protected] wrote: >Since one IP address maps to one exclusive server and >application, I need a way to have one client IP address map to multiple >fast_cgiSA servers and applications using some handle that >the client can pass along with the http call. Any further ideas would >greatly be appreciated. I think you're answering your own question. You need to deal in opaque handles to session state objects. The handles have to be available with each HTTP request to establish context; sounds like a job for a cookie. On the FastCGI side, you need to extract the cookie value and map it to the correct application-specific session state object(s); you'll need your own scheme to do this (probably map to a container object which gates to the correct state you can pass to the packaged code). If the fastCGI procs can share a lookup table, then you don't need affinity at all, just synchronization on the table access, best provided by a "monitor" module that manages all table ops. Then the fastCGIs just call the monitor to get the state object for the current CGI call. This approach of course requires some form of shared memory among the fastCGI processes. The programming pattern itself is pretty common (combo of GOF Memento, Composite, State and Mediator offhand). HTH, TW ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/