Java Mailing List Archive

http://www.junlu.com/

Home » users-digest.tomcat »

users Digest 15 Mar 2013 14:44:43 -0000 Issue 11298

users-digest-help

2013-03-15


Author LoginPost Reply

users Digest 15 Mar 2013 14:44:43 -0000 Issue 11298

Topics (messages 240420 through 240438)

Re: AW:AJP suddenly Stopps acting: ajp on 7009 and 9009 : connections keept open
 240420 by: André Warnier
 240421 by: David Kumar
 240422 by: André Warnier
 240426 by: David Kumar

Re: AJP suddenly Stopps acting: ajp on 7009 and 9009 : connections keept open
 240423 by: Rainer Jung
 240424 by: Rainer Jung
 240425 by: André Warnier
 240427 by: David Kumar
 240428 by: Rainer Jung
 240429 by: Rainer Jung
 240432 by: David Kumar
 240438 by: David Kumar

Re: configuring tomcat7 with apache 2.2.22
 240430 by: Jan Vávra
 240431 by: solar.essnmag.com
 240434 by: Jan Vávra
 240437 by: solar.essnmag.com

Re: tomcat 6.0.35 in production maintaince
 240433 by: Daniel Mikusa

Re: Procrun and Tomcat service/OS shutdown on Windows
 240435 by: Thomas, Steve
 240436 by: Thomas, Steve

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: users@(protected)
To unsubscribe, e-mail: users-digest-unsubscribe@(protected)
For additional commands, e-mail: users-digest-help@(protected)

----------------------------------------------------------------------


Attachment: users_240420.eml (zipped)
David Kumar wrote:
> hey,
>> Yes. Whether this is the java that runs tomcat is not immediately evident.
>> But it also seems that they concern port numbers like 7009, 9009 etc. which >must be your
>> AJP Connectors, so let's assume the CLOSE-WAITs all involve Tomcat.
>>
>> The first observation hat I would make is that this looks like a pretty >busy system.
>>
>> Then, there are 2100+ lines in that list. Let's assume first that they are >all internal
>> connections (which probable they are not, but for simplicity), so that >there are actually
>> 2 lines for the same connection, like these :
>>
>> tcp     0    0 127.0.0.1:39872      127.0.0.1:7009       >FIN_WAIT2
>> 20766/apache2
>> . ..
>> tcp6     1    0 127.0.0.1:7009       127.0.0.1:39872      >CLOSE_WAIT 20564/java
>>
>> ..
>>
>> So let's say that we have in total about 1000 connections active in some >state.
>> Compared to that, there are 54 connections in CLOSE_WAIT, which is like 5%.
>> That does not really sound "pathological" to me, considering that >CLOSE_WAIT is a normal
>> state through which any TCP connection goes at some point.
>>
>> If you look again at the above connection, and if I am not confusing my >clients and
>> servers again, it looks here like :
>> - Apache http (PID 20766), as a client, has established a connection to >port 7009 of the
>> server Tomcat (PID 20564). That must be an AJP connection, from the mod_jk >module of
>> Apache, to the AJP Connector in Tomcat.
>> - A while later, Apache closes the connection. It sends a "FIN" packet to >Tomcat, and
>> waits for Tomcat to acknowledge this FIN packet.
>> - when it receives the FIN packet from Apache, Tomcat responds with an ACK, >and then goes
>> to the CLOSE_WAIT state.
>> - when Apache receives the ACK from Tomcat, it goes to state FIN_WAIT2.
>>  (and that is the current state of the above connection)
>> - now Tomcat is supposed to send a FIN to Apache, and receive an ACK in >return.
>> - if Apache receives the FIN from Tomcat, it sends back an ACK, and goes >into state
>> TIME_WAIT (where it doesn't expect anything anymore), and then after a >short moment, it
>> discards that connection.
>>
>> If there are connections that remain in the CLOSE_WAIT state for very long, >it means that
>> something in the last 2 steps above is not working.
>>
>> Now in your listing, we see about 1900 lines in the TIME_WAIT state, all of >them *to* an
>> AJP port of Tomcat. This seems to suggest that the Apache side is working >as it should.
>> But if the Tomcat side stays in CLOSE_WAIT for a long time, then it would >suggest that on
>> the Tomcat side, that connection is never properly close()'d.
>
>> But this is the request/response connection, so I doubt that there would be >a bug there,
>> otherwise we'd have problems reports filling this list every day.
>>
>> Might there be that there is somewhere a discrepancy between the keep-alive >settings,
>> between Apache and Tomcat ?
>>
>> or maybe your server is just not strong enough for the load you are putting >on it ?
>
> According to vmtools the server is boring most times..

What do you mean, "boring" ? (like German "langweilig" ?).
If you have 2000+ connections there in one state or another, that should mean that the
system is usually pretty busy, I would think. On my production machines (vSphere VM's,
Linux, Apache+Tomcat, +database), some of them pretty busy, I never see more than 200-300
connections with netstat. That is all states together, with "netstat -t -pan | wc -l").
Granted, I am not running Yahoo or Facebook, but still, these are public Internet servers,
fairly sollicited.

>
> I almost totally agree, but I'm not sure if it is a AJP fault. Because most time everything is alright, so all of theses steps are done. Just sometimes after a arbitrarily amount of time ajp / tomcat runs crazy. And in my sample there is the sourceport 9009 / java. It looks for me that apache didn't received the ACK from tomcat after CLOSE_WAIT or it just don't care because apache thought this connections is already closed? Let's assume that is the case.. Isn't there a option to tell tomcat to wait max. time for a response and after that time kill the connection? As far as I understand connectionTimeout is just for the initial request, so after Apache did answer in first correctly connectionTimeout is valueless?
>
Let's look at the various options in the Connector :

First, the "-1" in some options means "unlimited" or "forever", it doesn't mean "disabled".
Second, some parameters say that if they are not specified, they default to the value of
another parameter, so you should check really what this other parameter is set to.


> Attached you can find our configuration files, maybe you can find a / some misconfigurations?
>

I'll have a look.

> I would agree that we have maybe a kind of misconfigured timeout problem...
>
>
> thanks
>
>
>
> Mit freundlichen Grüßen
> David Kumar
> Softwareentwickler, B. Sc.
> Abteilung Infotech - Interaktiv
> TELESTAR-DIGITAL GmbH
> Am Weiher 14
> D-56766 Ulmen
>
> http://www.telestar.de/
>
>
> ------------------------------------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)



Attachment: users_240421.eml (zipped)
Hey André,

> According to vmtools the server is boring most times..

>What do you mean, "boring" ? (like German "langweilig" ?).
--> Jep prety idle.. :-)
>If you have 2000+ connections there in one state or another, that should >mean that the
>system is usually pretty busy, I would think. On my production machines > (vSphere VM's,
>Linux, Apache+Tomcat, +database), some of them pretty busy, I never see >more than 200-300
>connections with netstat. That is all states together, with "netstat -t ->pan | wc -l").
>Granted, I am not running Yahoo or Facebook, but still, these are public >Internet servers,
>fairly sollicited.
>
> I almost totally agree, but I'm not sure if it is a AJP fault. Because >most time everything is alright, so all of theses steps are done. Just >sometimes after a arbitrarily amount of time ajp / tomcat runs crazy. And >in my sample there is the sourceport 9009 / java. It looks for me that >apache didn't received the ACK from tomcat after CLOSE_WAIT or it just >don't care because apache thought this connections is already closed? >Let's assume that is the case.. Isn't there a option to tell tomcat to wait >max. time for a response and after that time kill the connection? As far as >I understand connectionTimeout is just for the initial request, so after >Apache did answer in first correctly connectionTimeout is valueless?
>
>Let's look at the various options in the Connector :

>First, the "-1" in some options means "unlimited" or "forever", it doesn't >mean "disabled".
>Second, some parameters say that if they are not specified, they default to >the value of
>another parameter, so you should check really what this other parameter is >set to.

According to Tomcat Configuration Reference 5.5 :

connectionLinger  

The number of milliseconds during which the sockets used by this Connector will linger when they are closed. The default value is -1 (socket linger is disabled).

According to Tomcat Configuration Reference 7.0.37 :

connectionLinger  

The number of seconds during which the sockets used by this Connector will linger when they are closed. If not specified, the JVM default will be used.

As I'm at 7.0.37 I have to figure out where an how to set linger options at the JVM.


> I'll have a look.

thx



Attachment: users_240422.eml (zipped)
> David Kumar wrote:
>
>> Attached you can find our configuration files, maybe you can find a /
>> some misconfigurations?
>>
>
> I'll have a look.
>

Some notes :

- according to the comments in your Apache config file, you are using the "worker MPM".
But are you sure ? what does "/usr/sbin/apache2ctl -l" say ?

- we are missing the contents of your "/etc/apache2/workers.properties" file
- we are missing the JkMounts or equivalent that you are doing from Apache to Tomcat.
related questions : you have 2 tomcats. Are you doing load-balancing ? or are you just
sending some URLs to tomcat1 and other to tomcat2 ?
Are you proxying everything to the tomcats, or is the Apache httpd front-end serving some
URLs on its own ? if so, what proportion ?
- how many hits per second/minute/hour (any of them, approx.) is your server handling ?
- you do not have any specific timeout parameters set in your Tomcat AJP <Connectors>,
which is basically a good thing : better to leave the defaults in place, than to start
playing with settings that you do not really understand, and make things worse.

But you do set one :
connectionTimeout="200000". Which sounds extremely high to me.

Re: http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html

It means that when a client connects to that Connector, a Tomcat thread will be started to
handle this connection; then the thread will wait on the connection, to read the request.
If the request does not appear, this thread will still wait, up to 200 seconds (more than
3 minutes !) for this request to appear, before it gives up, closes that connection, and
goes back to the pool of available threads.
A normal client would not do that, but a badly-intentioned client that tries to create a
DOS attack on your server, will do that, just to block threads on your server until there
are no more threads available.

In this case, it is even worse, because other parameters are using this same value as a
default, like : keepAliveTimeout.

This one means that once one request has been processed by this Tomcat thread on that
connection, the thread will not close this connection, but wait to see if any other
request appears on that connection from the same client, within the timeout given.
In this case, because it defaults to connectionTimeout, the thread will wait more than 3
minutes to see if there is another request. If the client (browser) does not send any
additional request on that connection, you have a thread that is blocked doing nothing,
for more than 3 minutes.

In this case, the client is in reality the mod_jk module under Apache. So the settings of
Apache and mod_jk will matter, and I cannot tell exactly at this point what will happen.
But if this was a HTTP Connector open to the external WWW world, what would certainly
heppen is that you would run out of threads in Tomcat within a couple of minutes, and your
server would stop accepting new requests.

Or to put this another way : if this was a HTTP connector open to the outside world, and I
knew the address of your server, I could bring it down in 3 seconds, using the standard
"ab" program that comes with Apache.




Attachment: users_240426.eml (zipped)


Mit freundlichen Grüßen
David Kumar
Softwareentwickler, B. Sc.
Abteilung Infotech - Interaktiv
TELESTAR-DIGITAL GmbH
Am Weiher 14
D-56766 Ulmen

Tel.: + 49 (0) 6592 / 712 -2826
Tel.: + 49 (0) 2676 / 9520 -183

Fax: + 49 (0) 6592 / 712 -2829

http://www.telestar.de/




-----Ursprüngliche Nachricht-----
Von: André Warnier [mailto:aw@(protected)]
Gesendet: Freitag, 15. März 2013 10:45
An: Tomcat Users List
Betreff: Re: AW:AJP suddenly Stopps acting: ajp on 7009 and 9009 : connections keept open

>Some notes :

>- according to the comments in your Apache config file, you are using the >"worker MPM".
>But are you sure ? what does "/usr/sbin/apache2ctl -l" say ?

Compiled in modules:
core.c
mod_log_config.c
mod_logio.c
worker.c
http_core.c
mod_so.c



>- we are missing the contents of your "/etc/apache2/workers.properties" file
Sry didn't rename properties, see attached..

>- we are missing the JkMounts or equivalent that you are doing from Apache >to Tomcat.
Same to our default website

> related questions : you have 2 tomcats. Are you doing load-balancing ? or >are you just
>sending some URLs to tomcat1 and other to tomcat2 ?
We doing loadbalacning
>Are you proxying everything to the tomcats, or is the Apache httpd front->end serving some URLs on its own ? if so, what proportion ?
Everything goes to the tomcats
>- how many hits per second/minute/hour (any of them, approx.) is your >server handling ?
according to our logs yesterday between 8pm and 9pm we had 73667 hits together on both tomcats.
>- you do not have any specific timeout parameters set in your Tomcat AJP ><Connectors>,
> which is basically a good thing : better to leave the defaults in place, >than to start
>playing with settings that you do not really understand, and make things >worse.

But you do set one :
connectionTimeout="200000". Which sounds extremely high to me.

Re: http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html

>It means that when a client connects to that Connector, a Tomcat thread >will be started to
>handle this connection; then the thread will wait on the connection, to >read the request.
>If the request does not appear, this thread will still wait, up to 200 >seconds (more than
>3 minutes !) for this request to appear, before it gives up, closes that >connection, and
>goes back to the pool of available threads.
>A normal client would not do that, but a badly-intentioned client that >tries to create a
>DOS attack on your server, will do that, just to block threads on your >server until there
>are no more threads available.
>
>In this case, it is even worse, because other parameters are using this >same value as a
>default, like : keepAliveTimeout.

>This one means that once one request has been processed by this Tomcat >thread on that
>connection, the thread will not close this connection, but wait to see if >any other
>request appears on that connection from the same client, within the timeout >given.
>In this case, because it defaults to connectionTimeout, the thread will >wait more than 3
>minutes to see if there is another request. If the client (browser) does >not send any
>additional request on that connection, you have a thread that is blocked >doing nothing,
>for more than 3 minutes.

>In this case, the client is in reality the mod_jk module under Apache. So >the settings of
>Apache and mod_jk will matter, and I cannot tell exactly at this point what >will happen.
>But if this was a HTTP Connector open to the external WWW world, what would >certainly
>heppen is that you would run out of threads in Tomcat within a couple of >minutes, and your
>server would stop accepting new requests.
>
>
>Or to put this another way : if this was a HTTP connector open to the >outside world, and I
>knew the address of your server, I could bring it down in 3 seconds, using >the standard
>"ab" program that comes with Apache.

that is how our servers are connected together:

We have another Webserver (different server) connecting to our Apache - Proxy which is loadbalacning our two tomcats. (Apache and tomcat are together at on server)
I will go end reduce the timeout on both worker.properties and server.xml. What will be a value? 30 Seconds?

Thanks a lot..


workers.tomcat_home=/opt/tomcat
workers.java_home=/usr/lib/jvm/java-6-sun
ps=/

worker.list=loadbalancer,status

#//siehe https://community.jboss.org/wiki/OptimalModjk12Configuration
worker.tomcatX.host=localhost
worker.tomcatX.type=ajp13
worker.tomcatX.fail_on_status=404
worker.tomcatX.lbfactor=1
worker.tomcatX.ping_timeout=1000
worker.tomcatX.ping_mode=A
worker.tomcatX.socket_timeout=10
worker.tomcatX.connection_pool_timeout=200


worker.tomcat1.reference=worker.tomcatX
worker.tomcat1.port=7009

worker.tomcat2.reference=worker.tomcatX
worker.tomcat2.port=9009

worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=tomcat1,tomcat2

worker.status.type=status

<VirtualHost *:8080>
 ServerAdmin webmaster@(protected)

 SetEnvIf User-Agent "(internal dummy connection)$" dontlog
 SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog

 JkMount /* loadbalancer
 JKMount /status/* status
 #JkOptions   +DisableReuse

 DocumentRoot /var/www
 
 # Possible values include: debug, info, notice, warn, error, crit,
 # alert, emerg.
 LogLevel warn
 
 CustomLog "|/usr/bin/cronolog ${APACHE_LOG_DIR}/10.100.12.144/access.%Y%m%d.log" combined env=!dontlog
 ErrorLog "|/usr/bin/cronolog ${APACHE_LOG_DIR}/10.100.12.144/error.%Y%m%d.log"
 
 <Directory />
   Options FollowSymLinks
   AllowOverride None
 </Directory>

 <Directory /var/www/>
   Options FollowSymLinks
   AllowOverride None
   Order allow,deny
   allow from all
 </Directory>

</VirtualHost>

#<VirtualHost *:80>
#  <ifModule mod_alias.c>
#    Redirect 301 / http://10.100.12.144:8080
#  </ifModule>  
#</VirtualHost>


Attachment: users_240423.eml (zipped)
On 12.03.2013 11:58, David Kumar wrote:
> We got the connection_pool_timeout from here:
> https://community.jboss.org/wiki/OptimalModjk12Configuration
>
> I will have a look on the other recommended options

Pick a source download of mod_jk. It contains an example configuration
that should work pretty well. Don't choose the "minimal" example config,
just the normal one.

Regards,

Rainer



Attachment: users_240424.eml (zipped)
On 14.03.2013 10:04, David Kumar wrote:
>
> Hey,
>
> thanks for note..
> Attached you can find a new list.
> So, java is keeping these connections in close_wait.

close_wait for an AJP connection seen from Tomcat means the other side -
mod_jk - has closed the connection, but not Tomcat.

This is often due to a shorter Timeout on the mod_jk side than on the
Tomcat side. It is not a problem per se, but it is if it happens for too
many connections for a too long time.

I vaguely remember that you have a 10 second socket_timeout in your
workers.properties. That's typically bad. Look at the example config in
the source mod_jk download.

It could be, that your requests in Tomcat got stuck and Tomcat still is
in the state of working on the requests, therefore keeping the
connection open to send back stuff finally, whereas mod_jk has already
timed out. To check for that, take a couöple of threa dumps (not: heap
dumps) of the running Tomcat process while the close_wait problem is
visible. Check what your Tomcat threads are currently doing, e.g. are
they mostly sitting idle in the thread pool or executor, or are many of
them deep in your application stacks and waiting for database, locks or
other stuff.

Regards,

Rainer



Attachment: users_240425.eml (zipped)
Rainer Jung wrote:
> On 14.03.2013 10:04, David Kumar wrote:
>> Hey,
>>
>> thanks for note..
>> Attached you can find a new list.
>> So, java is keeping these connections in close_wait.
>
> close_wait for an AJP connection seen from Tomcat means the other side -
> mod_jk - has closed the connection, but not Tomcat.
>
> This is often due to a shorter Timeout on the mod_jk side than on the
> Tomcat side. It is not a problem per se, but it is if it happens for too
> many connections for a too long time.
>
> I vaguely remember that you have a 10 second socket_timeout in your
> workers.properties. That's typically bad. Look at the example config in
> the source mod_jk download.
>
> It could be, that your requests in Tomcat got stuck and Tomcat still is
> in the state of working on the requests, therefore keeping the
> connection open to send back stuff finally, whereas mod_jk has already
> timed out. To check for that, take a couöple of threa dumps (not: heap
> dumps) of the running Tomcat process while the close_wait problem is
> visible. Check what your Tomcat threads are currently doing, e.g. are
> they mostly sitting idle in the thread pool or executor, or are many of
> them deep in your application stacks and waiting for database, locks or
> other stuff.
>

Hi Rainer, a question to you :

In a previous post, David posted the output of "netstat -t -pan".
In that output, there are about 1900 connections from Apache to Tomcat's AJP connectors,
in state "TIME_WAIT".
As far as I know, this indicates that the connection is closed from the point of view of
Apache, and this TIME_WAIT should last only a few sec. maximum, and then should go away.
Why does he have so many though ? I can't see anything like that on any of my servers.


Attachment: users_240427.eml (zipped)

>close_wait for an AJP connection seen from Tomcat means the other side -
>mod_jk - has closed the connection, but not Tomcat.
>
>This is often due to a shorter Timeout on the mod_jk side than on the
>Tomcat side. It is not a problem per se, but it is if it happens for too
>many connections for a too long time.
>
>I vaguely remember that you have a 10 second socket_timeout in your
>workers.properties. That's typically bad. Look at the example config in
>the source mod_jk download.

I will do that.

>It could be, that your requests in Tomcat got stuck and Tomcat still is
>in the state of working on the requests, therefore keeping the
>connection open to send back stuff finally, whereas mod_jk has already
>timed out. To check for that, take a couöple of threa dumps (not: heap
>dumps) of the running Tomcat process while the close_wait problem is
>visible. Check what your Tomcat threads are currently doing, e.g. are
>they mostly sitting idle in the thread pool or executor, or are many of
>them deep in your application stacks and waiting for database, locks or
>other stuff.

I try to, currently we have a "watchdog" running, checking every 2 minutes if the tomcats are available at 7009/9009 and http. If one of the tomcats are not responding it will be restarted....



Thanks

David


Attachment: users_240428.eml (zipped)
On 15.03.2013 11:47, André Warnier wrote:
> Rainer Jung wrote:
>> On 14.03.2013 10:04, David Kumar wrote:
>>> Hey,
>>>
>>> thanks for note..
>>> Attached you can find a new list.
>>> So, java is keeping these connections in close_wait.
>>
>> close_wait for an AJP connection seen from Tomcat means the other side -
>> mod_jk - has closed the connection, but not Tomcat.
>>
>> This is often due to a shorter Timeout on the mod_jk side than on the
>> Tomcat side. It is not a problem per se, but it is if it happens for too
>> many connections for a too long time.
>>
>> I vaguely remember that you have a 10 second socket_timeout in your
>> workers.properties. That's typically bad. Look at the example config in
>> the source mod_jk download.
>>
>> It could be, that your requests in Tomcat got stuck and Tomcat still is
>> in the state of working on the requests, therefore keeping the
>> connection open to send back stuff finally, whereas mod_jk has already
>> timed out. To check for that, take a couöple of threa dumps (not: heap
>> dumps) of the running Tomcat process while the close_wait problem is
>> visible. Check what your Tomcat threads are currently doing, e.g. are
>> they mostly sitting idle in the thread pool or executor, or are many of
>> them deep in your application stacks and waiting for database, locks or
>> other stuff.
>>
>
> Hi Rainer, a question to you :
>
> In a previous post, David posted the output of "netstat -t -pan".
> In that output, there are about 1900 connections from Apache to Tomcat's
> AJP connectors, in state "TIME_WAIT".
> As far as I know, this indicates that the connection is closed from the
> point of view of Apache, and this TIME_WAIT should last only a few sec.
> maximum, and then should go away.
> Why does he have so many though ? I can't see anything like that on any
> of my servers.

TIME_WAIT is a state which means the connection is closed by both sides
but the TCP stack still blocks the (server port, server ip, client port,
client IP) quadruple for reuse to prevent long overdue packets of the
old connection to disturb the new connection. It doesn't prevent new
connections from being created nor are there still process resources on
client or server being used for those connections (threds, buffers). It
is just an entry in the OS TCP connection hash.

The TIME_WAIT state is only used on the side of the connection that
started the connection shutdown, i.e. that first send the FIN. The other
side doesn't go into TIME_WAIT. If your clients typically start the
connection shutdown you won't see the TIME_WAIT.

Connections are kept in TIME_WAIT for seconds to about a minute
depending on your OS and TCP tuning. For a service which uses a lot of
new connections per second and initiates the shutdown for them itself it
is not uncommon to see several hundreds to thousands of TIME_WAIT
connections. If the count goes up into the range of 10.000-50.000 you
could start running into inefficiencies of the TCP connection hash
handling (depending on the OS).

Regards,

Rainer


Attachment: users_240429.eml (zipped)
On 15.03.2013 11:57, David Kumar wrote:
>> It could be, that your requests in Tomcat got stuck and Tomcat still is
>> in the state of working on the requests, therefore keeping the
>> connection open to send back stuff finally, whereas mod_jk has already
>> timed out. To check for that, take a couöple of threa dumps (not: heap
>> dumps) of the running Tomcat process while the close_wait problem is
>> visible. Check what your Tomcat threads are currently doing, e.g. are
>> they mostly sitting idle in the thread pool or executor, or are many of
>> them deep in your application stacks and waiting for database, locks or
>> other stuff.
>
> I try to, currently we have a "watchdog" running, checking every 2 minutes if the tomcats are available at 7009/9009 and http. If one of the tomcats are not responding it will be restarted....

Please please before restarting take two thread dumps. On Linux/Unix a
"kill -QUIT" will do that (and write the result to STDOUT, which
depending on your setup likely goes to catalina.out). The QUIT signal
does *not* terminate the JVM, it just quickly writes out the stacks of
all threads. The interruption for the running JVM is minimal, so you can
already try how this works before the process gets into the critical state.

Regards,

Rainer



Attachment: users_240432.eml (zipped)
Hey,


>Please please before restarting take two thread dumps. On Linux/Unix a
>"kill -QUIT" will do that (and write the result to STDOUT, which
>depending on your setup likely goes to catalina.out). The QUIT signal
>does *not* terminate the JVM, it just quickly writes out the stacks of
>all threads. The interruption for the running JVM is minimal, so you can
>already try how this works before the process gets into the critical state.

great I just tried a kill -QUIT in our watchdog --> pretty fast. Next time we got our problem I will send the threaddump to you guys.


thanks a lot

David


Attachment: users_240438.eml (zipped)
Hey Rainer,

attached you can find a Threaddump. Just rename it to .zip.
I'm not sure waht all the stuff at the dump means. but I'm sure you know.. :-)

thanks

>Please please before restarting take two thread dumps. On Linux/Unix a
>"kill -QUIT" will do that (and write the result to STDOUT, which
>depending on your setup likely goes to catalina.out). The QUIT signal
>does *not* terminate the JVM, it just quickly writes out the stacks of
>all threads. The interruption for the running JVM is minimal, so you can
>already try how this works before the process gets into the critical state.

Attachment: users_240430.eml (zipped)
Hello,
I take care about an app that is a combination of Apache Server+php
Drupal app and Apache Tomcat jsp app.
Apache Server listens on the ports 80/443 and requests are reverse
proxied to Apache Tomcat.

Let's say that the tomcat app resides on/testca
The apache server config will be

 ProxyRequests Off
 ProxyPass /testca ajp://127.0.0.1:9081/testca
 ProxyPassReverse /testca ajp://127.0.0.1:9081/testca

     <Proxy /testca/WEB-INF>
     Order Deny,Allow
     Deny from All
     </Proxy>

     <Proxy /testca>
     Order Deny,Allow
     Allow from All
     </Proxy>

and check if ajp module is loaded:
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

In the Apache Tomcat's server.xml change ajp port to 9081
<Connector port="9081" protocol="AJP/1.3" redirectPort="8443" />


On WinXP there should be no problem. I personally develop on Win 7,
production is Linux.

Jan.


> Although not a newbie to building websites in html and php, and physical computing in C/C++, I'm having a dickens of a
> time understanding the documentation of Integrating Tomcat 7 with my existing Apache 2.2.22 on WinXP (company
> supplied development pc, nothing I can do about that). Can I get a bit of handholding please?
>
> I'm trying to evaluate a java servlet that requires tomcat.
>
>
> Steve Spence, KK4HFJ
> http://arduinotronics.blogspot.com
> http://www.essnmag.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>



Attachment: users_240431.eml (zipped)
Thanks to some advice on this forum, and a lot of independent study and experimentation, I have a php app on
apache (localhost:80) pulling in a database driven bar code from a IDAutomation Servlet running on tomcat
(localhost:8080).

Looks like this -

 $bcode = $row['Bar Code'] ;
 $beginurl = "<img src='http://localhost:8080/examples/servlet/LinearServlet?BARCODE=";
 $endurl = "&BAR_HEIGHT=.5&S=UPCA'>";
 echo $beginurl . $bcode . $endurl;


Steve Spence, KK4HFJ
http://arduinotronics.blogspot.com
http://www.essnmag.com


> -------Original Message-------
> From: Jan Vávra <vavra@(protected)>
> To: Tomcat Users List <users@(protected)>
> Subject: Re: configuring tomcat7 with apache 2.2.22
> Sent: Mar 15 '13 07:43
>
> Hello,
>   I take care about an app that is a combination of Apache Server+php
> Drupal app and Apache Tomcat jsp app.
>   Apache Server listens on the ports 80/443 and requests are reverse
> proxied to Apache Tomcat.
>
>   Let's say that the tomcat app resides on/testca
>   The apache server config will be
>
>    ProxyRequests Off
>    ProxyPass /testca ajp://127.0.0.1:9081/testca
>    ProxyPassReverse /testca ajp://127.0.0.1:9081/testca
>
>          <Proxy /testca/WEB-INF>
>          Order Deny,Allow
>          Deny from All
>          </Proxy>
>
>          <Proxy /testca>
>          Order Deny,Allow
>          Allow from All
>          </Proxy>
>
> and check if ajp module is loaded:
> LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
>
> In the Apache Tomcat's server.xml  change ajp port to 9081
>   <Connector port="9081" protocol="AJP/1.3" redirectPort="8443" />
>
>
> On WinXP there should be no problem. I personally develop on Win 7,
> production is Linux.
>
> Jan.
>
>
> > Although not a newbie to building websites in html and php, and physical computing in C/C++, I'm having a
dickens of a
> > time understanding the documentation of Integrating Tomcat 7 with my existing Apache 2.2.22 on WinXP
(company
> > supplied development pc, nothing I can do about that). Can I get a bit of handholding please?
> >
> > I'm trying to evaluate a java servlet that requires tomcat.
> >
> >
> > Steve Spence, KK4HFJ
> > http://arduinotronics.blogspot.com
> > http://www.essnmag.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@(protected)
> > For additional commands, e-mail: users-help@(protected)
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>


Attachment: users_240434.eml (zipped)
In this situation are both server exposed - Apache Server and Apache
Tomcat. It can work.

When you use reverse proxy only the Apache Server is exposed. So
configuring a ssl certificate is only done once.
On client computer/network there could be allowed only the standard http
port 80 and not 8080.

Depends on situation ...
Jan.



> Thanks to some advice on this forum, and a lot of independent study and experimentation, I have a php app on
> apache (localhost:80) pulling in a database driven bar code from a IDAutomation Servlet running on tomcat
> (localhost:8080).
>
> Looks like this -
>
>  $bcode = $row['Bar Code'] ;
>  $beginurl = "<img src='http://localhost:8080/examples/servlet/LinearServlet?BARCODE=";
>  $endurl = "&BAR_HEIGHT=.5&S=UPCA'>";
>  echo $beginurl . $bcode . $endurl;
>
>
> Steve Spence, KK4HFJ
> http://arduinotronics.blogspot.com
> http://www.essnmag.com
>
>
>>  -------Original Message-------
>>  From: Jan Vávra <vavra@(protected)>
>>  To: Tomcat Users List <users@(protected)>
>>  Subject: Re: configyuring tomcat7 with apache 2.2.22
>>  Sent: Mar 15 '13 07:43
>>  
>>  Hello,
>>   I take care about an app that is a combination of Apache Server+php
>>  Drupal app and Apache Tomcat jsp app.
>>   Apache Server listens on the ports 80/443 and requests are reverse
>>  proxied to Apache Tomcat.
>>  
>>   Let's say that the tomcat app resides on/testca
>>   The apache server config will be
>>  
>>    ProxyRequests Off
>>    ProxyPass /testca ajp://127.0.0.1:9081/testca
>>    ProxyPassReverse /testca ajp://127.0.0.1:9081/testca
>>  
>>        <Proxy /testca/WEB-INF>
>>        Order Deny,Allow
>>        Deny from All
>>        </Proxy>
>>  
>>        <Proxy /testca>
>>        Order Deny,Allow
>>        Allow from All
>>        </Proxy>
>>  
>>  and check if ajp module is loaded:
>>  LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
>>  
>>  In the Apache Tomcat's server.xml change ajp port to 9081
>>   <Connector port="9081" protocol="AJP/1.3" redirectPort="8443" />
>>  
>>  
>>  On WinXP there should be no problem. I personally develop on Win 7,
>>  production is Linux.
>>  
>>  Jan.
>>  
>>  
>>  > Although not a newbie to building websites in html and php, and physical computing in C/C++, I'm having a
> dickens of a
>>  > time understanding the documentation of Integrating Tomcat 7 with my existing Apache 2.2.22 on WinXP
> (company
>>  > supplied development pc, nothing I can do about that). Can I get a bit of handholding please?
>>  >
>>  > I'm trying to evaluate a java servlet that requires tomcat.
>>  >
>>  >
>>  > Steve Spence, KK4HFJ
>>  > http://arduinotronics.blogspot.com
>>  > http://www.essnmag.com
>>  >
>>  > ---------------------------------------------------------------------
>>  > To unsubscribe, e-mail: users-unsubscribe@(protected)
>>  > For additional commands, e-mail: users-help@(protected)
>>  >
>>  
>>  
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: users-unsubscribe@(protected)
>>  For additional commands, e-mail: users-help@(protected)
>>  
>>  
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>



Attachment: users_240437.eml (zipped)
In this scenario, both tomcat and apache are running on the same workstation (doesn't have to be, just give the ip
of the tomcat server in the script), and access is to intranet users only.


Steve Spence, KK4HFJ
http://arduinotronics.blogspot.com
http://www.essnmag.com


> -------Original Message-------
> From: Jan Vávra <vavra@(protected)>
> To: Tomcat Users List <users@(protected)>
> Subject: Re: configuring tomcat7 with apache 2.2.22
> Sent: Mar 15 '13 09:32
>
> In this situation are both server exposed - Apache Server and Apache
> Tomcat. It can work.
>
> When you use reverse proxy only the Apache Server is exposed. So
> configuring a ssl certificate is only done once.
> On client computer/network there could be allowed only the standard http
> port 80 and not 8080.
>
> Depends on situation ...
> Jan.
>
>
>
> > Thanks to some advice on this forum, and a lot of independent study and experimentation, I have a php app
on
> > apache (localhost:80) pulling in a database driven bar code from a IDAutomation Servlet running on tomcat
> > (localhost:8080).
> >
> > Looks like this -
> >
> >   $bcode = $row['Bar Code'] ;
> >   $beginurl = "<img src='http://localhost:8080/examples/servlet/LinearServlet?BARCODE=";
> >   $endurl = "&BAR_HEIGHT=.5&S=UPCA'>";
> >   echo $beginurl . $bcode . $endurl;
> >
> >
> > Steve Spence, KK4HFJ
> > http://arduinotronics.blogspot.com
> > http://www.essnmag.com
> >
> >
> >>   -------Original Message-------
> >>   From: Jan Vávra <vavra@(protected)>
> >>   To: Tomcat Users List <users@(protected)>
> >>   Subject: Re: configyuring tomcat7 with apache 2.2.22
> >>   Sent: Mar 15 '13 07:43
> >>  
> >>   Hello,
> >>     I take care about an app that is a combination of Apache Server+php
> >>   Drupal app and Apache Tomcat jsp app.
> >>     Apache Server listens on the ports 80/443 and requests are reverse
> >>   proxied to Apache Tomcat.
> >>  
> >>     Let's say that the tomcat app resides on/testca
> >>     The apache server config will be
> >>  
> >>      ProxyRequests Off
> >>      ProxyPass /testca ajp://127.0.0.1:9081/testca
> >>      ProxyPassReverse /testca ajp://127.0.0.1:9081/testca
> >>  
> >>            <Proxy /testca/WEB-INF>
> >>            Order Deny,Allow
> >>            Deny from All
> >>            </Proxy>
> >>  
> >>            <Proxy /testca>
> >>            Order Deny,Allow
> >>            Allow from All
> >>            </Proxy>
> >>  
> >>   and check if ajp module is loaded:
> >>   LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
> >>  
> >>   In the Apache Tomcat's server.xml  change ajp port to 9081
> >>     <Connector port="9081" protocol="AJP/1.3" redirectPort="8443" />
> >>  
> >>  
> >>   On WinXP there should be no problem. I personally develop on Win 7,
> >>   production is Linux.
> >>  
> >>   Jan.
> >>  
> >>  
> >>   > Although not a newbie to building websites in html and php, and physical computing in C/C++, I'm having
a
> > dickens of a
> >>   > time understanding the documentation of Integrating Tomcat 7 with my existing Apache 2.2.22 on
WinXP
> > (company
> >>   > supplied development pc, nothing I can do about that). Can I get a bit of handholding please?
> >>   >
> >>   > I'm trying to evaluate a java servlet that requires tomcat.
> >>   >
> >>   >
> >>   > Steve Spence, KK4HFJ
> >>   > http://arduinotronics.blogspot.com
> >>   > http://www.essnmag.com
> >>   >
> >>   > ---------------------------------------------------------------------
> >>   > To unsubscribe, e-mail: users-unsubscribe@(protected)
> >>   > For additional commands, e-mail: users-help@(protected)
> >>   >
> >>  
> >>  
> >>   ---------------------------------------------------------------------
> >>   To unsubscribe, e-mail: users-unsubscribe@(protected)
> >>   For additional commands, e-mail: users-help@(protected)
> >>  
> >>  
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@(protected)
> > For additional commands, e-mail: users-help@(protected)
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>


Attachment: users_240433.eml (zipped)
On Mar 14, 2013, at 6:00 PM, fachhoch wrote:

> I think one of my filters are involved in creating session , I tried in dev
> box calling the url called by load balancer ,and saw that a session is
> getting created  every time its a new browser, so then I  called a html
> file  still session is being created, I use some of the filters which I
> cannot make changes to, so I am, wondering , If I can add something  like
> a filter in web.xml which will bypass all other filters if url is lets say
> /myaap/ping.html how to bypass all other filters and serve the request ?

You could, but I think you're making this more complicated than it needs to be. If the filter is creating a session, then just change the filter-mapping so that it isn't applied for this resource. In your web.xml, look for the "filter-mapping" tag for the filter that is starting the session then just change it so the filter ignores this resource.

Having said that, if you absolutely want to create a custom filter, try the following:

1.) Implement Filter
2.) In the doFilter method, if request is a ping, handle it otherwise continue filter chain
3.) Define your filter in web.xml, make sure it's first in the filter chain

Now your filter should execute first, if it's a ping request it will just handle it. If not, it'll continue down the filter chain like normal.

Dan


>
>
>
>
> --
> View this message in context: http://tomcat.10.n6.nabble.com/tomcat-6-0-35-in-production-maintaince-tp4995740p4995967.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)


Attachment: users_240435.eml (zipped)
-----Original Message-----
From: Harris, Jeffrey E. [mailto:Jeffrey.Harris@(protected)]
Sent: Thursday, March 14, 2013 4:11 PM
To: Tomcat Users List
Subject: RE: Procrun and Tomcat service/OS shutdown on Windows



> -----Original Message-----
> From: Konstantin Kolinko [mailto:knst.kolinko@(protected)]
> Sent: Thursday, March 14, 2013 4:01 PM
> To: Tomcat Users List
> Subject: Re: Procrun and Tomcat service/OS shutdown on Windows
>
> 2013/3/14 Thomas, Steve <sthomas@(protected)>:
> > Hi -
> >
> > Running Tomcat 7.0.23 or 7.0.37 (32 or 64-bit) installed as a
> > service (either via service.bat or the exe installer) on a Windows 7
> > 64-bit OS, we are seeing an issue where the Windows shutdown kills
> > Tomcat before our webapp shutdown sequence has time to execute fully.
> > (Specifically, we just want to make sure our instance of HSQLDB
> > shuts down correctly, otherwise corruption can ensue.)
> >
> > Details:
> >
> > Initially we were running with 32-bit Tomcat 7.0.23 and saw that our
> > shutdown sequence was not being logged at all when one of our
> > customers shut down his laptop. It looked like the process was just
> > being killed. I found a commons-daemon/procrun bug and
> > corresponding fix that seemed like it should address the issue,
> > namely
> >
> > http://stackoverflow.com/questions/13578196/how-to-gracefully-
> shutdown
> > -procrun/14150785#14150785
> >
> > https://issues.apache.org/jira/browse/DAEMON-274
> >
> > I subsequently upgraded Tomcat to 7.0.36 (32-bit, zip) to get the
> updated commons-daemon (http://tomcat.apache.org/tomcat-7.0-
> doc/changelog.html), but to no avail. I thought perhaps the 32-bit
> Tomcat/64-bit OS might be a disconnect, so I installed the 64-bit
> version, but got the same result. In short, it looks like we're
> either doing something wrong with our code, or there's a new wrinkle
> in the OS-service handshaking, or the bug wasn't fixed
> correctly...maybe in that order.
> >
> > Details below on how our code manifested the problem as well as
> > other
> steps to reproduce.
> >
> > Our database shutdown code is located in the destroy() function of a
> class implementing org.springframework.beans.factory.DisposableBean.
> I added a Thread.sleep(5 min) call to reproduce it on my machine. As
> long as I shut down the service through the Services panel on Windows,
> the shutdown sequence fully executes (and takes 5 min, as expected).
> But if I just shut down Windows, the sequence is interrupted.
>
>
>
> 1. From the above I would say that is a Windows feature, that it does
> not wait for service to shutdown properly.
>
> I'd look into Windows support and MSDN, whether it is a configuration
> issue or something that be workaround by proper coding.
>

I proposed three options to Steve to change the Windows configuration to either allow more time, or to make Tomcat shutdown dependent on the database shutdown, or both.

> 2. On the "Shutdown" tab of the procrun service configuration dialog
> (Tomcat7w.exe) there is "Timeout" field.
>
> I have "0" (sec) there.

A good option, but it will not necessarily override the Windows default of 12 seconds to shut down a service.

Jeffrey Harris

This e-mail and any attachments are intended only for the use of the addressee(s) named herein and may contain proprietary information. If you are not the intended recipient of this e-mail or believe that you received this email in error, please take immediate action to notify the sender of the apparent error by reply e-mail; permanently delete the e-mail and any attachments from your computer; and do not disseminate, distribute, use, or copy this message and any attachments.

---------------------------------------------------------------------

Sorry, Jeffrey -- and thanks for pointing out your suggestions again -- I only saw your topmost comment last time around establishing a dependency on HSQLDB. I will check out your other options.

Regards,

Steve
This message is intended only for the named recipient. If you are not the intended recipient, you are notified that disclosing, copying, distributing or taking any action based on the contents of this information is strictly prohibited.



Attachment: users_240436.eml (zipped)
-----Original Message-----
From: Howard W. Smith, Jr. [mailto:smithh032772@(protected)]
Sent: Friday, March 15, 2013 12:11 AM
To: Tomcat Users List
Subject: Re: Procrun and Tomcat service/OS shutdown on Windows

On Thu, Mar 14, 2013 at 12:00 PM, Thomas, Steve <sthomas@(protected):

>
> Running Tomcat 7.0.23 or 7.0.37 (32 or 64-bit) installed as a service
> (either via service.bat or the exe installer) on a Windows 7 64-bit
> OS, we are seeing an issue where the Windows shutdown kills Tomcat
> before our webapp shutdown sequence has time to execute fully.


(Specifically, we just want to make sure our instance of HSQLDB shuts down
> correctly, otherwise corruption can ensue.)
>
>
Few months ago, my web app was running on Windows Server 2003 R2, 32-bit Client JVM and Tomcat versions 7.0.34 and 7.0.35. Within the last 3 months, my web app has been running on Windows Server 2008 R2, 64-bit Server JVM, and Tomcat version 7.0.35 and 7.0.37 (since I am running TomEE 1.5.2+).

anyway, Windows shutdown and restarted itself because of Windows Updates (automatic updates) and i have experienced at least 1 power outage due to storm(s), and my Apache Derby (embedded) has not corrupted yet, at all.
----------------------------------------------------

My manager has had our app and HSQLDB running for a while on his laptop and hasn't seen an issue, either. Our customer had several shutdowns where everything was fine (even though the shutdown sequence wasn't even started) and then had a couple where we had gotten so far as to issue the SHUTDOWN command to HSQLDB and then the database came back corrupt on the next startup.

Thanks for your input...still reviewing the posts today.

Regards,

Steve




This message is intended only for the named recipient. If you are not the intended recipient, you are notified that disclosing, copying, distributing or taking any action based on the contents of this information is strictly prohibited.


©2008 junlu.com - Jax Systems, LLC, U.S.A.