I've been trying to figure out how to do something and I've got an idea of
how to do it, but maybe someone
else has already done this, so any feedback you've got I'd appreciate...
I'm running mod_fastcgi with session affinity in an Apache2 web server on
Red Hat Fedora Linux. My fastcgi server and
associated application process are set as exclusive so that I can map one
user client PC to one running application.
My application is long-running and has state information that must remain
between web server calls. Having my application
be set as exclusive is not a problem, because one user will work with that
one application for an extended period of time--up to
an hour or more. Also, there are never more than 100 users of the system
at any one time.
What I would like to do is this. I would like to have one user on one
client machine to be able to start multiple numbers of these
applications, so I'd like to tie one use to potentially several or many of
these long-running applications. With mod_fastcgiSA now
set to exclusive it ties the client IP address or a cookie to one dedicated
server and application process. I'd like to tie a single
client to several of the same servers running exclusive with mod_fastcgiSA.
I'd like to pass some type of handle in the URL or
http data to have the session server map that user and handle to an
exclusive server and application.
This is how I thought it might be done. I am new to mod_fastcgiSA, so any
constructive criticism of this idea would be helpful
(as long as I don't have to pick my ego up off the floor ;). I thought
that create_fcgi_request in mod_fastcgi.c could be modified
to add another session_style type (maybe FCGI_SA_MULTI_EXCLUSIVE) and then
some http variable and value would be passed
with the URL. This value could be appended to sessionID before
fcgi_util_get_by_id is called. Something like the following:
#ifdef USE_SA
if (fs == NULL) {
ss = fcgi_util_ss_get_by_id(fs_path, uid, gid);
if (ss != NULL) {
if (ss->session_tracking == FCGI_SA_USECOOKIES) {
sessionID = fcgi_util_get_sessionid_by_cookie(p,ss,r);
} else {
sessionID = r->connection->remote_ip;
}
if (ss->session_style == FCGI_SA_EXCLUSIVE) {
fs = fcgi_util_sess_get_by_id(ss,sessionID,&too_busy);
else if (ss->session_style == FCGI_SA_MULTI_EXCLUSIVE) {
strcat( sessionID, <<<SOME HANDLE FROM CLIENT>>>);
/* added code */
fs = fcgi_util_sess_get_by_id(ss,sessionID,&too_busy);
} else {
fs = fcgi_util_sess_get_by_hash(ss,sessionID);
too_busy = 0;
}
if (too_busy == 1) {
ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r,
"FastCGI: No more free sessions for \"%s\"",
fs_path);
return NULL;
}
}
}
#endif /* USE_SA */
I need ideas for what <<<SOME HANDLE FROM CLIENT>>> could be from the
client.
Thanks for any ideas you have!
Larry Cousin
3M Health Information Systems
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.