This is a discussion on Same Apache server process? within the Linux Web Servers forums, part of the Web Server and Related Forums category; I have a dumb question: We all know Apache starts up a number of processes for load balancing. When a ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I have a dumb question:
We all know Apache starts up a number of processes for load balancing. When a user connects to Apache and browse through web pages, does the Apache server process that responded to the user request first keep replying to the user, or do different Apache server processes reply to the user as the user browse through web pages? In other words, do users get dedicated Apache server for them? Thank you in advance. |
|
|||
|
1443131@usenetplanet.com said:
>We all know Apache starts up a number of processes for load balancing. Not actually for load balancing, but to be able to faster serve the client requests. If the child processes were created only after the user connections, there would be an additional delay equivalent to the time needed to start the handler process in serving all the requests. Thus, Apache is reducing the service time delay by starting some server processes beforehand. >When a user connects to Apache and browse through web pages, does the >Apache server process that responded to the user request first keep >replying to the user, or do different Apache server processes reply to >the user as the user browse through web pages? This is a different issue, and it depends. In any case, when a TCP connection request to the server arrives, it is delegated to one of the available server processes (I understand Apache maintains an ordered list of processes, and new connection is delegated to the lowest-numbered/"first" available process in this list). In HTTP/1.0 and earlier, only one page element was served per TCP connection (so, element as in a picture, or stylesheet, or HTML document, etc). So, a typical page load would consist of a multiple TCP connections, and thus most possibly the client would end up being served by multiple Apache processes even in the context of loading a single "page". Depending on a client software, it would even be possible that the client was at any given time having multiple requests open to the server (f.ex. one for the main HTML document, and few more to retrieve the various images on the page). With HTTP/1.1 came the concept of keep-alive sessions - though even now it is possible for the client to request a non-keepalive session, and also it is possible for the server to refuse a request for a keepalive session from the client, and only serve in the HTTP/1.0-like non-keepalive mode. With keepalive sessions, the client can request an arbitary (or server-limited) number of HTTP resources using a single TCP connection (and thus just a single Apache server process). There is a server-imposed timeout in the keepalive sessions, so if there is no traffic between client and server for some given amount of time, the server will terminate the connection. The client can also terminate the connection, f.ex. if the user directs the client to a page residing on some other server. >In other words, do users get dedicated Apache server for them? So, users may get a server process that is dedicated for some span of time, but this is nowhere near guaranteed, and this happens mostly to improve the efficiency at the TCP connection level (to avoid multiple TCP connections for serving just a single page). -- Wolf a.k.a. Juha Laiho Espoo, Finland (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++ "...cancel my subscription to the resurrection!" (Jim Morrison) |
| Thread Tools | |
| Display Modes | |
|
|