Re: multiple rapid refreshes - how to handle them.

2001-10-17 Thread Perrin Harkins

 Is there a standard way of dealing with users who are on high
bandwidth
 connections who hit refresh (hold down F5 in IE for example) many
times
 on a page that generates alot of database activity?

Try this:
http://www.stonehenge.com/merlyn/LinuxMag/col17.html

- Perrin






Re: multiple rapid refreshes - how to handle them.

2001-10-17 Thread Les Mikesell

This doesn't solve the specific problem, but it is a good idea
to tune 'MaxClients' down in httpd.conf to a number that your
server can sustain.   The browsers may see a few errors during
the overload but the server will recover a lot faster when it stops.

  Les Mikesell
[EMAIL PROTECTED]


- Original Message - 
From: Mark Maunder [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, October 17, 2001 5:36 PM
Subject: multiple rapid refreshes - how to handle them.


 Is there a standard way of dealing with users who are on high bandwidth
 connections who hit refresh (hold down F5 in IE for example) many times
 on a page that generates alot of database activity?
 
 On a 10 meg connection, holding down F5 in IE for a few seconds
 generates around 300 requests and grinds our server to a halt. The app
 is written as a single mod_perl handler that maintains state with
 Apache::Session and cookies. content is generated from a backend mysql
 database.
 
 tnx!
 
 
 




multiple rapid refreshes - how to handle them.

2001-10-17 Thread Mark Maunder

Is there a standard way of dealing with users who are on high bandwidth
connections who hit refresh (hold down F5 in IE for example) many times
on a page that generates alot of database activity?

On a 10 meg connection, holding down F5 in IE for a few seconds
generates around 300 requests and grinds our server to a halt. The app
is written as a single mod_perl handler that maintains state with
Apache::Session and cookies. content is generated from a backend mysql
database.

tnx!






Re: multiple rapid refreshes - how to handle them.

2001-10-17 Thread Wim Kerkhoff

Mark Maunder wrote:
 
 Is there a standard way of dealing with users who are on high bandwidth
 connections who hit refresh (hold down F5 in IE for example) many times
 on a page that generates alot of database activity?
 
 On a 10 meg connection, holding down F5 in IE for a few seconds
 generates around 300 requests and grinds our server to a halt. The app
 is written as a single mod_perl handler that maintains state with
 Apache::Session and cookies. content is generated from a backend mysql
 database.

That mod_perl book has an example of how to create a handler that will
block greedy clients, such as somebody holding down the refresh button:

http://www.modperl.com/book/chapters/ch6.html#Blocking_Greedy_Clients

In brief, the concept is that you have a hash that is shared between all
processes via IPC::Shareable. On the first request from that client, you
set the counter to 0. On succeeding requests, you do a check to see if
the counter is greater than the forgivable amount for the elapsed time
period. If they've put too many requests through in X seconds, just
return FORBIDDEN or some other appropriate status. This simple handler
would run before you existing mod_perl handler.

-- 

Regards,

Wim Kerkhoff, Software Engineer
Merilus, Inc.  -|- http://www.merilus.com
Email: [EMAIL PROTECTED]