Ajp

Hi

I was wondering what people use to connect to tomcat with AJP

I found this site

But it’s not part of the 3rd party table on the wiki site.

Alex

Hi,

It’s a third party module. I haven’t put it on the wiki. The wiki are
edited by the third party module author, not the nginx official team.

If you have any problem with this module, you can report to me.

2012/10/25 Alex Samad - Yieldbroker [email protected]

Hi

Thanks, just started to look at it. I was wondering if other users of
nginx who use this module have had any experiences they would like to
share.

I would like to get a feel for something before I look at putting it
into production :slight_smile:

Is there any plan to do an official AJP module ?

Alex

From: [email protected] [mailto:[email protected]] On Behalf
Of ???
Sent: Thursday, 25 October 2012 4:39 PM
To: [email protected]
Subject: Re: AJP

Hi,

It’s a third party module. I haven’t put it on the wiki. The wiki are
edited by the third party module author, not the nginx official team.

If you have any problem with this module, you can report to me.
2012/10/25 Alex Samad - Yieldbroker
<[email protected]mailto:[email protected]>
Hi

I was wondering what people use to connect to tomcat with AJP

I found this site

But it’s not part of the 3rd party table on the wiki site.

Alex

Hi

So we have setup for using AJP, its meant to be faster ( I guess that
depends on the implementation :slight_smile: )
How did you deal with load balancing and stickiness.

Are you using long lived connections ?

Alex

Hi,

and don’t know about nginx and AJP, but why don’t you switch to HTTP
between nginx and tomcat ?

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 :wink:

2012/10/25 Alex Samad - Yieldbroker [email protected]:

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 :wink:

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. 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.


RPM

Posted at Nginx Forum:

2012/10/25 rmalayter [email protected]:

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).

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 !

Hi

We were in the same situation and didn’t want to take the risk to use
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).

Okay I have enough reason to try out http.

Still my question though how did you deal with stickiness?

[snip]

Alex

2012/10/25 Alex Samad - Yieldbroker [email protected]:

Jrme L. Wrote:

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).

Okay I have enough reason to try out http.

Still my question though how did you deal with stickiness?

http://code.google.com/p/nginx-sticky-module/

simple and efficient ! works like a charms without any configuration
on the tomcat side and no need to setup complex session sharing system
on the tomcat side

Hi

[snip]

Behalf Of Jrme L.
Sent: Friday, 26 October 2012 3:35 AM
To: [email protected]
Subject: Re: AJP
[snip]

Still my question though how did you deal with stickiness?

Google Code Archive - Long-term storage for Google Code Project Hosting.

So just for my understand what is the difference between this 3rd party
add on and the ajp 3rd party addon.

I understand one is on the wiki and one is not. But does that mean the
sticky module is supported as well ?

Does stick respect jsession cookie. So if server fails will the
connection go to new server and then eventually bounce back to the
restored old server ?

simple and efficient ! works like a charms without any configuration on the
tomcat side and no need to setup complex session sharing system on the
tomcat side

That’s good like KISS

[snip]

2012/10/25 Alex Samad - Yieldbroker [email protected]:

Still my question though how did you deal with stickiness?

Google Code Archive - Long-term storage for Google Code Project Hosting.

So just for my understand what is the difference between this 3rd party add on
and the ajp 3rd party addon.

I understand one is on the wiki and one is not. But does that mean the sticky
module is supported as well ?

Does stick respect jsession cookie. So if server fails will the connection go to
new server and then eventually bounce back to the restored old server ?

sticky module does not deal with jsession cookie. It creates a cookie
on its own which indicates which backend has been used and nginx will
always use the backend from the cookie.

If no cookie are sent (first time), nginx will use standard round
robin to choose one server and then send back a cookie indicating
which backend server has been used.

If the backend from the server is down, classic round robin takes
place and a new cookie is sent with the new backend to use.

see the main page of Google Code Archive - Long-term storage for Google Code Project Hosting.
with the explanation and a smal schematic which is far better than any
explaination