1

On Windows i connect Apache2 to Tomcat7 via AJP.

Is there any configuration that can throttle the communication?

This is my workers.properties

worker.list=node1
worker.node1.port=8009
worker.node1.host=127.0.0.1
worker.node1.type=ajp13

This is my httpd.conf:

<VirtualHost 127.0.0.1:80>
  JkMount /* node1
</VirtualHost>

We need to test upload-progress-bars and async request in enterprise ajax application.


mod_bw does not work with JkMount.

Grim
  • 135
  • 7

1 Answers1

1

As far as I know AJP neither on the Apache nor on the Tomcat end does throttling, but instead tries to pass the request on between the layers as fast as it can.

Here are some thoughts:

One can set connection limits for workers, which when reached leads to the worker not accepting more connections, so as to avoid saturation and overload.

One can introduce more backend hosts and balance workers between them, so as to increase capacity.

One can limit bandwidth in Tomcat for instance using custom filters, which would be a coding solution.

One can use the http connector instead of AJP in order to use the compression option, and possibly increase throughput over the same connections.

One can introduce network level bandwidth control to throttle the AJP connection throughput "from the outside". In Linux this could be done natively using the iptables --limit and --limit-burst directives. To the best of my knowledge Windows is however lacking a native network level bandwith throttling solution. Lucckily there are third-party add-ons which provide granular bandwidth control such as Netlimiter and Netbalancer.

Looking outside the OS one could run the connections through a limiter appliance such as a hardware load balancer, but then why use AJP at all?

Critical though is that whichever way you manage to do your throttling, you need to see that both Apache and Tomcat has capacity to let their request queues/backlogs grow, as one can imagine the session count increases if requests are fulfilled more slowly.

Finally, IIS has native bandwidth throttling, and can reverse-proxy/URL rewrite through the ARR module to a backend Tomcat. I am not sure if throttling is available to ARR:ed connections, but if you are on Windows anyway it may be worth taking a look.

ErikE
  • 4,676
  • 1
  • 19
  • 25