Why is this QoS jetty-filter not working?

Viewed 962

We want to apply the QoS Jetty Filter to our Solr 6.5 servers so that any rate higher than the benchmarked rate is rejected outrightly.

The required jar files are present:

/app/solr6/server/lib/jetty-servlets*.jar
/app/solr6/server/lib/jetty-util*.jar

And the XML file where we can add the configuration for the filter is at:

/app/solr6/server/solr-webapp/webapp/WEB-INF/web.xml

Solr runs with -Djetty.home=/app/solr6/server and I have confirmed that if we remove the above XML file, solr fails to start in jetty. So the XML file above is the correct location for putting the QoS filter.

Problem is that I am unable to get the QoS filter up and running with the following config:

<filter>
  <filter-name>QoSFilter</filter-name>
  <filter-class>org.eclipse.jetty.servlets.QoSFilter</filter-class>
  <init-param>
    <param-name>maxRequests</param-name>
    <param-value>1</param-value>
  </init-param>
  <init-param>
    <param-name>waitMS</param-name>
    <param-value>1000</param-value>
  </init-param>
  <init-param>
    <param-name>suspendMS</param-name>
    <param-value>500</param-value>
  </init-param>
 </filter>
 <filter-mapping>
  <filter-name>QoSFilter</filter-name>
  <url-pattern>*</url-pattern>
</filter-mapping>

I have a single node Solr running with the above configuration but no rate limiting seems to be happening. I have a client with 30 threads (running on 8 cores machine) and I do not see any reduction in queries/second when I apply the above filter on the Solr server.

How do I know the filter is working and throttling the rate of my requests at all?

0 Answers
Related