Posted At : March 18, 2010 1:20 AM 2 Comments
This has been something I've been looking at, but haven't found a compelling reason for one over the other.
Proxy AJP is claimed to be faster as it is a "Wire protocol" but I couldn't find any benchmarks around this.
So I decided to do a very quick and dirty benchmark to satisfy my curiosity. This is not a scientific process, I just ran a simple railo testpage on the same machine with 50 threads of jmeter requests hitting it.
First I enabled proxy_http and ran it four times, then enabled proxy_ajp and repeated. The config is below:
| Run | HTTP Requests/sec | AJP Requests/sec |
|---|---|---|
| Run 1 | 206.9 | 181.4 |
| Run 2 | 203.9 | 143.6 |
| Run 3 | 194.6 | 189.2 |
| Run 4 | 204.6 | 191.4 |
| Average | 202.5 | 176.4 |
The results showed that the proxy_http module was faster - i.e. more requests per second could be pushed through.
I'm putting this down to the fact that proxy_ajp has to convert the http request into it's binary format, while proxy_http really just has to pass it along.
In different scenarios and network configurations the results may be different, but for now I'm going to stick with the http proxy.
Proxy AJP has one other benefit, in that is passes along some extra flags such as whether the request is https or not, but for our purposes we don't need this.
Cheers, Mark
2 Comments
Hi Mark,
For a standalone server, without clustering and support for session stickyness you will notice a better performance using mod_proxy_http, when you start clustering the reverse will be true.
Here is a description from the Tomcat site describing the two connectors
http://tomcat.apache.org/tomcat-5.5-doc/connectors...
Thanks Gary,
That makes sense, and gives a good rule of thumb for when to use each.
Simple setup - use proxy_http
Cluster setup - use proxy_ajp
Cheers,
Mark