SPUG: Re: slowing down a web form

Richard Anderson starfire at zipcon.net
Wed Jul 26 08:58:57 CDT 2000


The first thought that would occur to me is to have the CGI script called by
the form increment a counter in a file named using today's date.  Once you
have a backlog of seven daily counts, have the CGI script read the daily
submission rate from seven days ago and throw a random number to reject
submissions at a rate that will bring the submission rate down to the
desired rate.   Crude but effective.  Don't forget to use flock to prevent
multiple instances of the CGI script from writing the file simultaneously.
A cron job to delete counter files older than seven days would be tidy.

Richard.Anderson at raycosoft.com
www.zipcon.net/~starfire/home (personal)
www.raycosoft.com (corporate)
----- Original Message -----
From: "jeff" <jeff at planetoid.net>
Cc: <spug-list at pm.org>
Sent: Tuesday, July 25, 2000 2:23 PM
Subject: SPUG: slowing down a web form


> What's a good technique (using cgi and perl/apache/mysql) to slow down
> or control the number of times a form can be submitted per hour?
>
> I need to throttle down a membership application page on a web site to
> restrict the number of submissions or applications per hour to some
> number.
>
> I've heard that mod_simultaneous manages hit rates to web pages but I
> haven't used it before. So...
>
> Any ideas.
>
> --
> Jeff Saenz
> jeff at planetoid.net
>
>
>
>  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>      POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
>       Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
>   Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
>  For full traffic, use spug-list for LIST ; otherwise use spug-list-digest
>   Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
>
>
>


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For full traffic, use spug-list for LIST ; otherwise use spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list