yaoweibin / nginx_ajp_module

support AJP protocol proxy with Nginx
http://github.com/yaoweibin/nginx_ajp_module
246 stars 59 forks source link

About connect() failed (110: Connection timed out) message.. #36

Open bwahn opened 9 years ago

bwahn commented 9 years ago

Hi~

We are use nginx(1.6.2), nginx_ajp_module(https://github.com/yaoweibin/nginx_ajp_module/archive/master.zip) and apache_tomcat(6.0.35). 5 machines for nginx, and 16 instances for tomcat.

The configuration of nginx is as bellow : nginx.conf : events { worker_connections 20000; }

upstream tomcat_worker_multi { server 192.168.100.100:8009; server 192.168.100.100:8019; server 192.168.100.100:8029; server 192.168.100.100:8039; check interval=3000 rise=2 fall=5 timeout=100 type=ajp; } keepalive_timeout 0;

location / { ajp_keep_conn on; ajp_pass tomcat_worker_multi; }

We've got lots of error messages in error.log as bellow : [error] 15148#0: *25812196 connect() failed (110: Connection timed out) while connecting to upstream, client: xx.xx.xx.xx, server: localhost, request: "GET /foo HTTP/1.1", upstream: "ajp://192.168.100.100:8009", host: "api.foo.com"

[error] 15148#0: *25812196 connect() failed (110: Connection timed out) while connecting to upstream, client: xx.xx.xx.xx, server: localhost, request: "GET /foo HTTP/1.1", upstream: "ajp://192.168.100.100:8019", host: "api.foo.com"

[error] 15148#0: *25812196 connect() failed (110: Connection timed out) while connecting to upstream, client: xx.xx.xx.xx, server: localhost, request: "GET /foo HTTP/1.1", upstream: "ajp://192.168.100.100:8029", host: "api.foo.com" ... ...

Also, manual of ajp_module like this : default: ajp_connect_timeout 60s; This directive assigns a timeout for the connection to the upstream server. It is necessary to keep in mind that this time out cannot be more than 75 seconds.

we don't configure a specific value of ajp_connect_timeout, and I'm thinking the value is 60s. Do you have idea why we've got a error messages?