I have been testing nginx with Tomcat backend server, and I was
disappointed
with the result. 30-40% worse than apache front web server setup.
I think the culprit of the performance problem is the absence of
persistent
connection (KeepAlive HTTP/1.1) to Tomcat like Apache’s AJP connection.
Does anyone has the same problem?
Anyone with a good solution?
I was getting more than 70-80,000 sockets in TIME_WAIT.
I had to use tcp_timestamp to recycle them faster otherwise I get huge
dip in performance
once in a while (along with IP port range all open)
Since MSL is 60 second, that is more than 1200 TCP connections/sec.
All there is to my nginx config is upstream and proxy_pass config.
that’s it.
I have been testing nginx with Tomcat backend server, and I was
disappointed
with the result. 30-40% worse than apache front web server setup.
I think the culprit of the performance problem is the absence of
persistent
connection (KeepAlive HTTP/1.1) to Tomcat like Apache’s AJP connection.
Does anyone has the same problem?
Anyone with a good solution?
Thank you.
Chang
Hey, Im using tomcat, its running on localhost port 8180, without AJP
and works quite fine. I dont see any actual issue with it.
Maybe try to eliminate AJP connector, just use it the clasic way and it
might work better, try also this kernel settings:
Maybe I wasn’t articulate enough.
I am not using AJP port, I am simply using Tomcat directly.
And I have all those sysctl setting correct, except tcp_timestamps.
With tcp_timestamps=0, I am overflowing with too many sockets in
TIME_WAIT. I have to use timestamps=1 to reduce the number of
sockets in TIME_WAIT.
Maybe I wasn’t articulate enough.
I am not using AJP port, I am simply using Tomcat directly.
And I have all those sysctl setting correct, except tcp_timestamps.
With tcp_timestamps=0, I am overflowing with too many sockets in
TIME_WAIT. I have to use timestamps=1 to reduce the number of
sockets in TIME_WAIT.
1/20/09, ���� 12:15, Robert G. �ۼ�:
Well for me work… I dont know about timestamps, but I have to check a
bit on it, maybe you are right, but the rest of them will be usefull.
Also I use tomcat without keep-alive… meaning in nginx I have
keep-alive=0 and seems to work, faster and quite well… but I dont know
how good it is.
Maybe I wasn’t articulate enough.
I am not using AJP port, I am simply using Tomcat directly.
And I have all those sysctl setting correct, except tcp_timestamps.
With tcp_timestamps=0, I am overflowing with too many sockets in
TIME_WAIT. I have to use timestamps=1 to reduce the number of
sockets in TIME_WAIT.
1/20/09, ���� 12:15, Robert G. �ۼ�:
Well for me work… I dont know about timestamps, but I have to check a
bit on it, maybe you are right, but the rest of them will be usefull.
Also I use tomcat without keep-alive… meaning in nginx I have
keep-alive=0 and seems to work, faster and quite well… but I dont know
how good it is.
P.S. I dont think tcp_timestamps is such a good idea to be set to 1…
try to search it only, but I wouldnt recommend it.
Usually tcp_timestamps=1 is not a good idea since it adds overhead to
TCP
processing, but my case is that if I don’t have that one, sockets in
TIME_WAIT
grows unboundedly in such a way that the system runs out of port or
cannot allocate more sockets (throughput drops dramatically
periodically)