________________________________
From: Konstantin Kolinko <knst.koli...@gmail.com>
To: Tomcat Users List <users@tomcat.apache.org> 
Sent: Thursday, December 6, 2012 11:10 PM
Subject: Re: how to make http port to open after application startup

2012/12/6 Vladimir Girnet <vgirn...@yahoo.com>:
> I'm using Tomcat 6.0 (6.035 for now).
>
> I've got an issue with balancing multiple connections from httpd to tomcat.
> It looks like tomcat is opening http port (8080) right after startup, and is 
> accepting connections on it.
> At the same time, application itself is starting for about 1-2 minutes, 
> depending on server speed.
>
> Because connections are accepted to http port, httpd is not removing starting 
> tomcat from balancer members.
> As result, a lot of connections are directed to currently starting tomcat, 
> but no connections are served during application startup.
>
> I have multiple tomcat servers behind http. If I want to restart one of these 
> servers, httpd will still pass requests to it, making users to wait long time 
> before response is received.
>
> Is it possible to configure tomcat to open http port only after application 
> is fully started?
>
> I found that AJP port is started only after application startup, 
> unfortunately system is fully configured to use http, and migrating to AJP 
> generate too much overhead for us.

1. Is it really better to reject a request?


No, I don't want to reject requests. I want no requests to be forwarded to 
tomcat by httpd if tomcat is not ready to serve requests. 
2.
a) You can configure connector programmatically e.g. via JMX, or by
using Tomcat classes directly.

JMX support is better in Tomcat 7. It may be scarce in Tomcat 6.


This is not possible for me, tomcat 6 is the only option. 

b) You can configure a rule in a firewall and manage it programmatically,

This is exactly how I'm doing right now. 

c) You can manage your load balancer programmatically.

http://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html#balancer_manager


httpd 2.2 is used on my servers, playing with balancer members is a good 
option, but require a script to manage this on all web servers. 

> I found that AJP port is started only after application startup

3. Is it really true? It might be there, but it is the first time I
hear about such feature.

I can't connect to AJP port till application is fully started, and this is in 
startup log file - AJP connector is opened at the end (even on clean tomcat, 
just downloaded it from site and tried again).

AJP protocol supports ping/pong requests, so it can check
responsiveness of the server before sending the actual request.

Thanks anyway, I'll try to find a working option for me. 


Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to