[thelist] MySQL & perl question

Seb seb at admin.evolt.org
Tue Nov 7 13:31:45 CST 2000


> >We would like to implement a feature that will prevent users from
"flooding"
> >message boards with the same message over a short period of time (a few
> >minutes).
> >
> >However, we are not sure how to do that. Anyone have any ideas? We
currently
> >have about 200-300 messages posted daily, and the numbers are growing all
> >the time.

Without the overhead of hitting the DB, when somebody posts, set a cookie
with an expiry of about 1 hour, and keep track of the number of posts in
that cookie. If the cookie already exists, just increment the counter in the
cookie.

When the number of posts/hour exceeds your limit, block the user until the
cookie expires.

Of course, if the user realises you're using cookies to flood, they could
just disable them. So you could require cookies. Up to you.

If you're using a server-side tech that supports sessions, you could just
track the #posts in a session variable.

Finally, rather than searching the posts themselves by user and time range,
you could just rotate hourly log files that track by user id/IP address and
#posts, and pattern match through them. Of course, this adds the overhead of
file handles.

Remember, tracking by IP means that you're going to end up tracking a lot of
people through firewalls. Especially AOL users, so you'll need to make
allowances for multiple users through the same IP.


Seb.







More information about the thelist mailing list