Multiple QS_CondLocRequestLimitMatch directives?

2014-02-19
2014-03-11
  • Hello

    Wonder if there is any reason behind this limitation:

    QS_CondLocRequestLimitMatch <regex> <number> <condition>
    ...
    Only one QS_CondLocRequestLimitMatch rule is evaluated per request.

    We have a web service going through HTTPD and want to setup different throttling for different SOAP operations. The operation comes in the SOAPAction header. Here I am at the moment:

    httpd.conf:

    ...
    SetEnvIf SOAPAction CancelOrder QS_Cond=CancelOrder
    QS_CondLocRequestLimitMatch "/soap.*" 2 CancelOrder
    ...

    However there are many SOAP operations and for each we want different QoS. 'QS_CondLocRequestLimitMatch' is evaluated only once per request. This will not work, I guess:

    ...
    SetEnvIf SOAPAction CancelOrder QS_Cond=CancelOrder
    SetEnvIf SOAPAction ChangeOrder QS_Cond=ChangeOrder
    SetEnvIf SOAPAction SubmitOrder QS_Cond=SubmitOrder
    QS_CondLocRequestLimitMatch "/soap." 2 CancelOrder
    QS_CondLocRequestLimitMatch "/soap.
    " 5 ChangeOrder
    QS_CondLocRequestLimitMatch "/soap.*" 10 SubmitOrder
    ...

    How could I come around this limitation?

    Cheers
    Balazs

     
  • However there are many SOAP operations and for each we want different QoS.

    therefore, you may configure different rules (one for each operation as long as a HTTP request contains only one - otherwise you could define an expression which covers your scenarios)

     
  • As far as I understood only one 'QS_CondLocRequestLimitMatch' is evaluated per HTTP request. If we declare more than one in a switch-case like construct then the 2nd, 3rd etc. will be ignored.

    Let's say, there are 4 different SOAP operations: A, B, C and D. (Only 1 operation per HTTP request is allowed.) Each is identified through the value of the 'SOAPAction' HTTP header, the request URL is always the same. We want to define these concurrent request limits:

    A: 2
    B: 3
    C: 6
    D: 10

    With 'QS_CondLocRequestLimitMatch' so far we could achieve this:

    A|B|C: 4
    D: 10

    Is there any way to have more than one 'QS_CondLocRequestLimitMatch'?

     
  • why not using a rule like this?

    SetEnvIf SOAPAction CancelOrder CancelOrder
    SetEnvIf SOAPAction ChangeOrder ChangeOrder
    SetEnvIf SOAPAction SubmitOrder SubmitOrder
    SetEnvIf Request_URI /soap URLMATCH
    QS_SetEnvIF URLMATCH CancelOrder CancelOrder_Event=y
    QS_SetEnvIF URLMATCH ChangeOrder ChangeOrder_Event=y
    QS_SetEnvIF URLMATCH SubmitOrder SubmitOrder_Event=y
    QS_EventRequestLimit CancelOrder_Event 2
    QS_EventRequestLimit ChangeOrder_Event 5
    QS_EventRequestLimit SubmitOrder_Event 10
    
     
  • Thanks, works like a charm.