Deploying the request throttling sample project

Following this guide, you can deploy and test the sample project limiting concurrent requests in IPS.

Prerequisites

  1. If you haven’t already done so,

    • define a container image with user adroitlogic, name ips-worker and tag 17.07 (you can utilize the Select Existing button on the container image creation page to use the already defined image from the image repository).

    • create a cluster using the abovementioned container image.

  2. Find the host system’s address on the host-only network associated with your IPS virtual machine. This will usually be the first IP address of the host-only network IP range, e.g. if your VM’s host-only address (obtained using ips_installer ip) is 192.168.99.100 the corresponding address on the host would be 192.168.99.1.

Deployment

  1. Navigate to the project creation page.

  2. Click the Select a Sample button and select the Limiting Concurrent Requests sample.

  3. Click Next and wait for IPS to download the sample XPR from the repository, after which you will be automatically navigated to the Configure page.

    throttling
  4. Click Next again on the Configure page as we do not want to change any of the default project properties.

  5. In the Assign page, select the cluster you have created previously, and click Deploy Now.

  6. You will be directed to the Deployments perspective of the selected cluster, with the new project added automatically to the Pending Updates list.

    If you had already deployed a project in the selected cluster, which exposes the same port as the Limiting Concurrent Requests sample (i.e. 8280), the project will not be added to the pending updates list and an error message indicating the port conflict will be displayed (as two projects in the same deployment cannot bind to the same port). In that case, you can manually Delete the conflicting project from the Deployed Projects list and use the Add Project button on the upper right hand corner to select the LimitingConcurrentRequests project for deployment.
  7. Map an external port (e.g. 30040) to the exposed port 8280 of the sample project, using the Configure button.

  8. Click Deploy and wait for the progress bar to indicate successful completion of the deployment.

Testing

  1. Find the IP address on the host-only interface of your IPS virtual machine using the ips_installer ip command (which would usually be 192.168.99.100).

  2. As explained in the sample documentation, send a load of POST requests to http://192.168.99.100:30040/service/throttling-service via the Java Bench tool included in Ultra Studio, with concurrency above 10.

    concurrency throttle in java bench
  3. Via the ESB log viewer observe how the concurrency throttle maintains the maximum concurrent load on the fast processing server endpoint below 10, while routing the rest of the requests to the slow processing server:

    2017-08-15T16:35:20,645 [ip-hostname] [pool-3-thread-7] [limiting-concurrent-requests-17.07] [XPR12001I003]  INFO LoggerProcessingElement Forwarding to request to fast processing server.
    2017-08-15T16:35:20,704 [ip-hostname] [pool-3-thread-6] [limiting-concurrent-requests-17.07] [XPR12001I003]  INFO LoggerProcessingElement Forwarding to request to fast processing server.
    ...
    2017-08-15T16:35:20,846 [ip-hostname] [pool-3-thread-20] [limiting-concurrent-requests-17.07] [XPR12001I003]  INFO LoggerProcessingElement Forwarding to request to fast processing server.
    2017-08-15T16:35:20,851 [ip-hostname] [pool-3-thread-11] [limiting-concurrent-requests-17.07] [XPR12001I003]  INFO LoggerProcessingElement Concurrency limit reached. Forwarding to request to slow processing server.
    2017-08-15T16:35:20,851 [ip-hostname] [pool-3-thread-2] [limiting-concurrent-requests-17.07] [XPR12001I003]  INFO LoggerProcessingElement Concurrency limit reached. Forwarding to request to slow processing server.
    ...
In this topic
In this topic
Contact Us