proxy_http vs proxy_ajp benchmark
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:
<IfModule mod_proxy_http.c>
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPassMatch ^/(.*\.cfm)$ http://testsite.railo:8080/$1
ProxyPassReverse / http://testsite.railo:8080/
</IfModule>
<IfModule mod_proxy_ajp.c>
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPassMatch ^/(.*\.cfm)$ ajp://testsite.railo:8009/$1
ProxyPassReverse / ajp://testsite.railo:8009/
</IfModule>
Results:
| 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
Our service:
It works great, but when I tried it in my new install the sound was all choppy, i.e. I would get every half of each second of the audio.