Forum Moderators: phranque

Message Too Old, No Replies

Limit the max #connections to a web page.

Help Me Please

         

realaaaaa

8:17 am on Oct 17, 2008 (gmt 0)

10+ Year Member



Can Apache Limit to #connections for a web page?
Or is it possible for me to limit the connections for a web page on my server.
For example, if a user come to visit example.php, example.php will excute for about 3 seconds. During the 3 seconds , any new users who visit example.php , will wait for the first user . when the first user finish, other users can excute example.php, one by one.

I want to find the most effective way to realize this function.
Any help will be appreciated!

jdMorgan

3:02 pm on Oct 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Apache cannot limit connections to a page, it can only limit the total maximum number of connections per Apache server child process. That is, it can limit the number of connections to *all* resources on the server, including pages, images, external CSS stylesheets and JavaScripts, multimedia files, etc. If you have server configuration level access, then see MaxRequestsPerChild in the Apache core documentation, and the "Apache Tuning" tutorial, also at apache.org.

I can tell you that most Web users do not "wait" for anything. If they do not get some response from your Web site within one-half second of their request, many will leave. After five seconds, almost all will have left and gone somewhere else. Therefore, this plan is not a good one, and you should re-assess *why* you think you need to lock the script for that length of time. You should look into separating the process that takes such a long time from the actual rendering of the page, and give all users something to look at while the process completes.

With more information about exactly what you are doing during that long time period, it's likely that someone in our PHP forum could suggest an alternate design that avoids this long delay, and avoids "locking" the page for any user. Do not rush into implementation details when the requirements and design phases are not finished yet.

Jim

realaaaaa

3:40 pm on Oct 17, 2008 (gmt 0)

10+ Year Member



thx man.