Menu

Limit the requests per IP

Sailaja
2014-03-24
2014-04-08
  • Sailaja

    Sailaja - 2014-03-24

    We have a requirement to limit webserver requests as below:
    --> to limit the requests at webserver level based on IP
    --> only certain number of requests should be processed by webserver per IP, after reaching the threshold webserver should reject the requests and give 500 response
    i.e, for example, only one request from IP should be processed by webserver and the following requests needs to be rejected.

    Please suggest us how the configuration can be achieved with the help of mod_qos

    Regards,
    Sailaja.

     
  • Pascal Buchbinder

    use QS_ClientEventLimitCount

     
  • Sailaja

    Sailaja - 2014-04-08

    Thank you Pascal..!

    I have configured as below for limiting the requests for all IPs
    SetEnvIf Request_URI /fp/services2/* QS_Limit
    QS_ClientEventLimitCount 5 5

    The above configuration is common for all IPs. i.e, Apache will process the number of requests specified by the counter for all IPS in a same way.

    Now I would like to configure such that Apache should process the requests based on IPs. for example, from one IP apache should accept 4 requests and for different IP Apache should accept 2 requests.

    I would like to know whether this configuration is possible or not.

    Please suggest me..

    Thanks & Regards,

    Sailaja.

     

Log in to post a comment.