Hi Everyone !

Currently, I am implementing a mechanism to restrict the number of
parallel connections to the server from a single client/user.

The mechanis is something like :

- Use Cache::FastMmap to share the data between multiple processes.

- PerlAccessHandler will get the key for cache to get the current
count of alive connections.

The key could be some URL parameter, cookie or IP.

It increments the count by 1 and stores the result back into the cache. 

Deny the connection if count exceeds the maximum limit.

-PerlCleanuphandler decrements the count.

I am interested in knowing if I am missing some obvious point here.
This mechanism is working nicely. Are there any better alternatives
available without any overhead of chache/locking etc.

Thanks,
Pratik
-- 
http://pratik.syslock.org

Reply via email to