AJP

Jérôme Loyet jerome at loyet.net
Thu Oct 25 16:34:30 UTC 2012


2012/10/25 rmalayter <nginx-forum at nginx.us>:
> Jérôme Loyet Wrote:
> -------------------------------------------------------
>> We were in the same situation and didn't want to take the risk to use
>> a third party module, so we switched to HTTP and it's just perfect.
>>
>> my 2 cents ;)
>
> We did the same here. Now that nginx does keep-alives to the back-ends,
> there's really no advantage to using AJP between the web server and Tomcat.
>
>
> In fact, our internal load testing showed nginx->HTTP->Tomcat performing
> marginally better than Apache->AJP->Tomcat with Tomcat serving a simple test
> JSP.

Same results here. In fact the way nginx works (async) compensate the
loss due to switching to HTTP (and even more than expected).

>I suspect this is because the HTTP code in Tomcat has been optimized
> far more than the AJP code. However, in the real world your bottlenecks will
> always be DB, disk IO, and memory/garbage collection caused by your app at
> the Tomcat layer.
>
> Profile your app, and find out where the bottlenecks actually are. Address
> the worst ones first. I suspect communication overhead between your web
> server and Tomcat isn't even visible no matter what you use. Proper caching,
> efficient client-side layout and script, DB query tuning, etc. all matter
> far more. Spend whatever optimization time you have on that which will make
> a real difference for the end-user.

in all the cases, there's 99% chances that you'll gain more by
tweaking your app than trying to optimize the protocol between nginx
and tomcat !

>
> --
> RPM
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,232172,232225#msg-232225
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list