1 Reply Latest reply on Apr 7, 2006 12:10 PM by sappenin

    WS Throttling and load monitoring

    Ryan Pape Newbie


      I would like to throttle the load to my web service such that when a user/IP/etc exceeds a certain query per second threashold, their requests are dropped or error out.

      Does anyone have suggestions as to how I approach the problem?

      I also desire a realtime monitoring as a graph in queries per second. An easy implementation would be to use JMS to notify an external monitoring facility, but this seems less than ideal.

        • 1. Re: WS Throttling and load monitoring
          sappenin Novice

          First, see this post for one method to obtain the ip address of your caller using a GenericHandler.

          http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3935845#3935845

          Using this method, you can essentially (by creating a class that extends GenericHandler) intercept any web-services calls to any web-service that we want intercepted (based on QName).

          So, once we have an ip, we could call query a database, or run some other logic inside of our handler, and dermine how many calls per hour, minute, etc a given ip has made. If an ip has exceeded a given threshold, then simply don't call the "super.handleRequest(context)" function (this is in the override of the "public boolean handleRequest(MessageContext context)" in GenericHandler -- see the referenced post above. However, if the ip has not exceeded our threshold, then by calling super.handleRequest(..), our SEI is called, and the web-service call proceeds normally.

          I'd appreciate hearing any other alternatives you might find for throttling a web-service...I'm looking for some best practices, too.

          Thanks!

          David