You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Cohen, Laurence" <lc...@novetta.com> on 2015/09/02 21:54:53 UTC

Help with Tomcat Applications not listening

Hi,

We have a webserver and an appserver, and the webserver talks to the
appserver on port 8007.  Every once the communication will stop, and we
will notice an error on the webserver saying that it can't talk to the
appserver.  When this happens, I will run a netstat -an |grep 8007 on the
appserver, and there are hundreds of connections to that port.  When I
restart the app, it will be back to about 10 connections, and they will
start growing again.

I'm trying to figure out why they are growing so quickly, and why they
aren't dying when the connection is no longer needed.

Any help would be appreciated.

Thanks,

Larry Cohen

Re: Help with Tomcat Applications not listening

Posted by Mark Thomas <ma...@apache.org>.
On 02/09/2015 21:53, Cohen, Laurence wrote:
> Thank you Chris,
> 
> We only have one webserver and two tomcat applications on the back end.
> Where do I set the connections allowed if we are using mod_proxy_httpd?

If this is the issue (and it is a good bet it is) the quick (and not
that dirty) solution is to switch to the NIO HTTP connector on the
Tomcat side.

Mark

> 
> Thanks,
> 
> Larry Cohen
> 
> On Wed, Sep 2, 2015 at 4:47 PM, Christopher Schultz <
> chris@christopherschultz.net> wrote:
> 
> Larry,
> 
> On 9/2/15 3:54 PM, Cohen, Laurence wrote:
>>>> We have a webserver and an appserver, and the webserver talks to
>>>> the appserver on port 8007.  Every once the communication will
>>>> stop, and we will notice an error on the webserver saying that it
>>>> can't talk to the appserver.  When this happens, I will run a
>>>> netstat -an |grep 8007 on the appserver, and there are hundreds of
>>>> connections to that port.  When I restart the app, it will be back
>>>> to about 10 connections, and they will start growing again.
>>>>
>>>> I'm trying to figure out why they are growing so quickly, and why
>>>> they aren't dying when the connection is no longer needed.
> 
> My guess is that the number of connections coming from httpd and the
> number of connections allowed to Tomcat don't match up.
> 
> How many web servers? How many back-end Tomcats? Which connector are
> you using?
> 
> If w = # of httpd instances
>    c = # of total httpd threads
> then you need w * c connections allowed in all of your Tomcats (see
> <Connector> attribute maxConnections.
> 
> Another possibility is that the connection timeouts on httpd (mod_jk
> connect_timeout, in ms) versus Tomcat (<Connector> connectionTimeout,
> in ms) are not the same.
> 
> -chris
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 
> 


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


Re: Help with Tomcat Applications not listening

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Larry,

On 9/2/15 4:53 PM, Cohen, Laurence wrote:
> We only have one webserver and two tomcat applications on the back
> end. Where do I set the connections allowed if we are using
> mod_proxy_httpd?

So you have a single Tomcat server and a single web server?

No problem, but it's important to know:

1. Which httpd MPM you are using (prefork, event, etc.)
2. Which Tomcat connector you are using (BIO, NIO, APR)

- -chris

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJV6Gm+AAoJEBzwKT+lPKRYDYQP/jnpTisRs5FFO8VVnSmuPUHg
BEfCt0waBKowiB9AsbZWlLt1P+swgNF2P8evXWKtLzPMlWyxs4B35QqcaRq7Ewyl
HkKMeKcddq4chAoFyfUcuWJzRwpFmQ0gyaKj/W4Zpo2W0Mj8t0OZx6UySTiFtkEv
lGt4c+cFdB3BZOeF5MaHa8Br0AVHz3id7jK82+pFlaE/pYmpPyw6slhZe3Zlmi07
iOtRSB0khmOZl+OX0BKEupScfUdBhRKPMt0S8x0+jYzs1hX4kj3eFHvlBNz1zQxU
A35wU4ODX9Lo9mvvYqav1RYuiG9mAAtLz2pkk0XcVaYuy06CAC0kK9Nwq+7Ua1aw
QH6UD/nGFjWAmYVHYmKhNTyGFswqluky3ytGCjeXcOGaQjRTuu6f82lyl5T5oUKG
UFMJkdRjw+d2v/IVqOMgP1qwr7oOTFqjxBojzctjrTtPmADLUT+hua+rShbRCfNA
ACMI//cbr+sLEcshioa21RfK1hYmueHoSL+o4RevWjMtpQ/8WOLbB8XPXLyIJH2v
6YMPC84DuRpwiHjzHdAbrTywKlpo8FvZjA3Ly+plyYUlT5wUQ0fJWkntx5CPNuql
pPEVPZhw+q6F8A0f0vfJAjcoYltGV323Uj/8p1imx6+VAKZwD4uiLTE4dqbHcwSA
QGVaLq/udk5UzXbbbUgk
=i9/r
-----END PGP SIGNATURE-----

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


Re: Help with Tomcat Applications not listening

Posted by "Cohen, Laurence" <lc...@novetta.com>.
Thank you Chris,

We only have one webserver and two tomcat applications on the back end.
Where do I set the connections allowed if we are using mod_proxy_httpd?

Thanks,

Larry Cohen

On Wed, Sep 2, 2015 at 4:47 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Larry,
>
> On 9/2/15 3:54 PM, Cohen, Laurence wrote:
> > We have a webserver and an appserver, and the webserver talks to
> > the appserver on port 8007.  Every once the communication will
> > stop, and we will notice an error on the webserver saying that it
> > can't talk to the appserver.  When this happens, I will run a
> > netstat -an |grep 8007 on the appserver, and there are hundreds of
> > connections to that port.  When I restart the app, it will be back
> > to about 10 connections, and they will start growing again.
> >
> > I'm trying to figure out why they are growing so quickly, and why
> > they aren't dying when the connection is no longer needed.
>
> My guess is that the number of connections coming from httpd and the
> number of connections allowed to Tomcat don't match up.
>
> How many web servers? How many back-end Tomcats? Which connector are
> you using?
>
> If w = # of httpd instances
>    c = # of total httpd threads
> then you need w * c connections allowed in all of your Tomcats (see
> <Connector> attribute maxConnections.
>
> Another possibility is that the connection timeouts on httpd (mod_jk
> connect_timeout, in ms) versus Tomcat (<Connector> connectionTimeout,
> in ms) are not the same.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJV52BfAAoJEBzwKT+lPKRYPKkP/AlnFjGxvPJPyjw3vhjDowiZ
> NS2vKKQZiQfzW/xqn30cbE3HJheC+7vL+ErhqCBlehZmuoFngaLiT5fpR2cPvwaM
> XdKB5xa7HJ/vOIBqY2vLwM0cYuqAMgYHP+MFpwGJyi3ezoyf0cn+D78y9HPJIOta
> K04BrKm5ZRlxMqtuCeGdP/hdT59H8X+S2XLzJ5oug8090TCHqDOmnz+tzR9BDe6o
> c0GgzdXTs+EweGgaq57V9dNaZl/GnrMkkDDhqS2AyEPhG7kjVKELQ0Rx2cbSGvLG
> EoAincsN3tMNx5vG/ZfHLf93qwB2jfqCMVnedMg7urOTtDDH8aDFhuixDxzUhHwL
> iulppCeeMEy8UpQV5KOLeqcww+OXZz+uLHPhP+vvqBMVhBt6Sxh1JlckqthBb3KH
> fc1rztloe+iw9ehVFX1654/zgVKkj77FtNZcc4bU+KGYoQmIb1fdGSfNBTTd6OTS
> eU1IHkb0GTsUkMa4/RZn9WhQ6r+ya8ZZL0RqtZB3nZgOr3tY2dO/aXFTu01S1meR
> 8wUvPEN/0bYgKMjV4qCWnpYEUdw8K9FmAphqEQThzy+4NlhfUDG7vvg+LqvTkAzt
> gS1S3pV6LPK2fBjKUbShLwJW3dCvEGu016oMiLHEpwBFVEC8WWl7sIV3SgZXqNZP
> 1k/PoTnoLV3KFsBhKKbr
> =lCAl
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 

[image: www.novetta.com]

Larry Cohen

System Administrator


12021 Sunset Hills Road, Suite 400

Reston, VA 20190

Email  lcohen@novetta.com

Office  703-885-1064

Re: Help with Tomcat Applications not listening

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Larry,

On 9/2/15 3:54 PM, Cohen, Laurence wrote:
> We have a webserver and an appserver, and the webserver talks to
> the appserver on port 8007.  Every once the communication will
> stop, and we will notice an error on the webserver saying that it
> can't talk to the appserver.  When this happens, I will run a
> netstat -an |grep 8007 on the appserver, and there are hundreds of
> connections to that port.  When I restart the app, it will be back
> to about 10 connections, and they will start growing again.
> 
> I'm trying to figure out why they are growing so quickly, and why
> they aren't dying when the connection is no longer needed.

My guess is that the number of connections coming from httpd and the
number of connections allowed to Tomcat don't match up.

How many web servers? How many back-end Tomcats? Which connector are
you using?

If w = # of httpd instances
   c = # of total httpd threads
then you need w * c connections allowed in all of your Tomcats (see
<Connector> attribute maxConnections.

Another possibility is that the connection timeouts on httpd (mod_jk
connect_timeout, in ms) versus Tomcat (<Connector> connectionTimeout,
in ms) are not the same.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJV52BfAAoJEBzwKT+lPKRYPKkP/AlnFjGxvPJPyjw3vhjDowiZ
NS2vKKQZiQfzW/xqn30cbE3HJheC+7vL+ErhqCBlehZmuoFngaLiT5fpR2cPvwaM
XdKB5xa7HJ/vOIBqY2vLwM0cYuqAMgYHP+MFpwGJyi3ezoyf0cn+D78y9HPJIOta
K04BrKm5ZRlxMqtuCeGdP/hdT59H8X+S2XLzJ5oug8090TCHqDOmnz+tzR9BDe6o
c0GgzdXTs+EweGgaq57V9dNaZl/GnrMkkDDhqS2AyEPhG7kjVKELQ0Rx2cbSGvLG
EoAincsN3tMNx5vG/ZfHLf93qwB2jfqCMVnedMg7urOTtDDH8aDFhuixDxzUhHwL
iulppCeeMEy8UpQV5KOLeqcww+OXZz+uLHPhP+vvqBMVhBt6Sxh1JlckqthBb3KH
fc1rztloe+iw9ehVFX1654/zgVKkj77FtNZcc4bU+KGYoQmIb1fdGSfNBTTd6OTS
eU1IHkb0GTsUkMa4/RZn9WhQ6r+ya8ZZL0RqtZB3nZgOr3tY2dO/aXFTu01S1meR
8wUvPEN/0bYgKMjV4qCWnpYEUdw8K9FmAphqEQThzy+4NlhfUDG7vvg+LqvTkAzt
gS1S3pV6LPK2fBjKUbShLwJW3dCvEGu016oMiLHEpwBFVEC8WWl7sIV3SgZXqNZP
1k/PoTnoLV3KFsBhKKbr
=lCAl
-----END PGP SIGNATURE-----

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


Re: Help with Tomcat Applications not listening

Posted by "Cohen, Laurence" <lc...@novetta.com>.
1. apache httpd 2.2.x
2. mod_proxy_httpd
3. I'll have to clean up this information.
4. 7.0.59, jdk 1.8u51
5. I'll have to clean up this information.
6. Yes, we have iptables running on both the app server and web server but
even when we shut them down we still have the problem.

I'll send 3 and 5 as soon as possible.

Thanks,

Larry

On Wed, Sep 2, 2015 at 4:39 PM, Mark Eggers <it...@yahoo.com.invalid>
wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Larry,
>
> On 9/2/2015 12:54 PM, Cohen, Laurence wrote:
> > Hi,
> >
> > We have a webserver and an appserver, and the webserver talks to
> > the appserver on port 8007.  Every once the communication will
> > stop, and we will notice an error on the webserver saying that it
> > can't talk to the appserver.  When this happens, I will run a
> > netstat -an |grep 8007 on the appserver, and there are hundreds of
> > connections to that port.  When I restart the app, it will be back
> > to about 10 connections, and they will start growing again.
> >
> > I'm trying to figure out why they are growing so quickly, and why
> > they aren't dying when the connection is no longer needed.
> >
> > Any help would be appreciated.
> >
> > Thanks,
> >
> > Larry Cohen
> >
>
> Unfortunately, I don't have Pid's crystal ball. A little more
> information is needed.
>
> 1. web server information
>    (platform, web server software, version)
> 2. method of web server - app server connection
>    (mod_jk, mod_proxy_ajp, mod_proxy_http)
> 3. Configuration for the connection
> 4. Tomcat information
>    (platform, Java, version)
> 5. Connector configuration
> 6. Any intervening firewalls that might try to be "helpful"
>
> I'm guessing that something is keeping the connections active, or that
> there are no timeouts configured.
>
> It could also be a DOS attack.
>
> What does your application do (in general)? Can you replicate this
> problem in a test environment simulating normal (expected) traffic?
>
> . . . lots of questions, not a lot of answers
> /mde/
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
>
> iQEcBAEBAgAGBQJV515nAAoJEEFGbsYNeTwtORoH+gKHsKGdvE0h455iNb1agNQS
> xjoF8kFd/turT2mfZaMnwhgJWi8qQekIWK+x0f1qgssYKytiBr5YcMwdUfOSv4l3
> bJK175qdpg2Vq4KvuYmEZnAQZCL99oDPhXWPLqQMmfRWgZBkU2neg3GMj+b5uyI1
> XZUxkezuhHIckSc8Rdc7JQ8KLPyFfm4ONWEKiN7L1Q6ZyHm9J9EL/0vOsrBr2x8g
> aer/VPM6bZ5W3BY0VSeYRGyykcpnU9GgapJ4xIW6kqgVGdbdYN+X39XxoJ2YQ9nl
> h76z2F4GkoItm1uOCT/1kDiqDxDutNXwxI5k5tswnN9SFBZgykFaiWR9a7mVfzI=
> =W4h4
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 

[image: www.novetta.com]

Larry Cohen

System Administrator


12021 Sunset Hills Road, Suite 400

Reston, VA 20190

Email  lcohen@novetta.com

Office  703-885-1064

Re: Help with Tomcat Applications not listening

Posted by Mark Eggers <it...@yahoo.com.INVALID>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Larry,

On 9/2/2015 12:54 PM, Cohen, Laurence wrote:
> Hi,
> 
> We have a webserver and an appserver, and the webserver talks to
> the appserver on port 8007.  Every once the communication will
> stop, and we will notice an error on the webserver saying that it
> can't talk to the appserver.  When this happens, I will run a
> netstat -an |grep 8007 on the appserver, and there are hundreds of
> connections to that port.  When I restart the app, it will be back
> to about 10 connections, and they will start growing again.
> 
> I'm trying to figure out why they are growing so quickly, and why
> they aren't dying when the connection is no longer needed.
> 
> Any help would be appreciated.
> 
> Thanks,
> 
> Larry Cohen
> 

Unfortunately, I don't have Pid's crystal ball. A little more
information is needed.

1. web server information
   (platform, web server software, version)
2. method of web server - app server connection
   (mod_jk, mod_proxy_ajp, mod_proxy_http)
3. Configuration for the connection
4. Tomcat information
   (platform, Java, version)
5. Connector configuration
6. Any intervening firewalls that might try to be "helpful"

I'm guessing that something is keeping the connections active, or that
there are no timeouts configured.

It could also be a DOS attack.

What does your application do (in general)? Can you replicate this
problem in a test environment simulating normal (expected) traffic?

. . . lots of questions, not a lot of answers
/mde/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJV515nAAoJEEFGbsYNeTwtORoH+gKHsKGdvE0h455iNb1agNQS
xjoF8kFd/turT2mfZaMnwhgJWi8qQekIWK+x0f1qgssYKytiBr5YcMwdUfOSv4l3
bJK175qdpg2Vq4KvuYmEZnAQZCL99oDPhXWPLqQMmfRWgZBkU2neg3GMj+b5uyI1
XZUxkezuhHIckSc8Rdc7JQ8KLPyFfm4ONWEKiN7L1Q6ZyHm9J9EL/0vOsrBr2x8g
aer/VPM6bZ5W3BY0VSeYRGyykcpnU9GgapJ4xIW6kqgVGdbdYN+X39XxoJ2YQ9nl
h76z2F4GkoItm1uOCT/1kDiqDxDutNXwxI5k5tswnN9SFBZgykFaiWR9a7mVfzI=
=W4h4
-----END PGP SIGNATURE-----

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


Re: Help with Tomcat Applications not listening

Posted by je...@gmail.com.
Larry,


Make sure that you’re closing any resource that you’ve opened.


Jeff






Sent from Windows Mail





From: Cohen, Laurence
Sent: ‎Wednesday‎, ‎September‎ ‎2‎, ‎2015 ‎2‎:‎54‎ ‎PM
To: Tomcat Users List





Hi,

We have a webserver and an appserver, and the webserver talks to the
appserver on port 8007.  Every once the communication will stop, and we
will notice an error on the webserver saying that it can't talk to the
appserver.  When this happens, I will run a netstat -an |grep 8007 on the
appserver, and there are hundreds of connections to that port.  When I
restart the app, it will be back to about 10 connections, and they will
start growing again.

I'm trying to figure out why they are growing so quickly, and why they
aren't dying when the connection is no longer needed.

Any help would be appreciated.

Thanks,

Larry Cohen