issue with process-per-request

This is a discussion on issue with process-per-request within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hi, I have seen some discussion on how process-per-request is probably good in performance. Without the headache of ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-21-2004
Yan Zhou
 
Posts: n/a
Default issue with process-per-request

Hi,

I have seen some discussion on how process-per-request is probably good in
performance. Without the headache of getting in multi-thread programming, it
is a good choice.

But I wonder how would a process-per-request system keep session states,
since subsequent requests within the same session can be served by different
processes? I suppose the same issue lies in multi-threading system as well.

Thanks.
Yan


  #2 (permalink)  
Old 09-21-2004
Hornet
 
Posts: n/a
Default Re: issue with process-per-request


Yan Zhou wrote in message ...
> Hi,
> I have seen some discussion on how process-per-request is probably good in
> performance. Without the headache of getting in multi-thread programming, it
> is a good choice.
> But I wonder how would a process-per-request system keep session states,
> since subsequent requests within the same session can be served by different
> processes? I suppose the same issue lies in multi-threading system as well.
> Thanks.
> Yan



This is a general programming question.
In most of cases, more processes = less performance.
Another thing to mention is ,in most of cases, at some point you will have to
synchronize used processes so they execute one-by-one, and not in parallel which
is better.
Less synchronization = more performance.
Exchanging data between processes would require synchronization.
I hope this helps,
regards











  #3 (permalink)  
Old 09-21-2004
Yan Zhou
 
Posts: n/a
Default Re: issue with process-per-request

I have no problem with performance or synchronization, but I would like to
know what are some strategys to keep session states since different
processes/threads can serve requests within the same user session.

Yan


  #4 (permalink)  
Old 09-21-2004
Hornet
 
Posts: n/a
Default Re: issue with process-per-request


Yan Zhou wrote in message ...
> I have no problem with performance or synchronization, but I would like to
> know what are some strategys to keep session states since different
> processes/threads can serve requests within the same user session.


I assume that processes need to exchange that information.
To my best knowledge, if two or more processes are aware of same information
acquired after processes have been created, they are using some form of
inter-process communication.
Hope this helps,







  #5 (permalink)  
Old 09-21-2004
Eric Schwartz
 
Posts: n/a
Default Re: issue with process-per-request

"Yan Zhou" <yzhou@medplus.com_REMOVE> writes:
> I have no problem with performance or synchronization, but I would like to
> know what are some strategys to keep session states since different
> processes/threads can serve requests within the same user session.


This is a basic problem with trying to use a stateless protocol for a
stateful application. Fortunately, since it's so basic, everybody has
solved it already. Whatever language you are using will have at least
several mechanisms for keeping session state. In the case of Perl,
several hundred, most likely. :)

I strongly recommend you look into the tools provided by whatever
language you're writing your code in, and use those, instead of trying
to reinvent them.

To specifically answer your question, the basic idea is that you
associate some unique ID with a session, and then store the
information associated with that session on the server somewhere, and
store the ID with the user somehow (either via a cookie, or via
rewriting URLs to include the session ID somehow).

Then, each time the user requests a resource, you are also handed the
session ID, which you then use to fetch the session information back
from wherever you stored it. Again, there exist modules right now for
nearly every language that will store session information in shared
memory, in files, in databases, and who knows where else. Use them.

-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:16 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0