parallel webapp initialization
Hello mailing list. We use a single tomcat instance (soon switching from 5.5.23 to 7.x) with 24 webapps. Each webapp is based on spring and hibernate doing a lot of I/O during initialization. Tomcat is often restarted which causes long downtimes. As far as i can see the tomcat initializes its wepapps sequentially. So despite the fact, that our tomcat-intance runs on a 8 core linux system, tomcat seems to use a single thread to initalize the webapps. Is there a way on tomcat 7 to make it initialize webapps in parallel? Or is there a basic obstacle? Thanks for your help Alex Knöller -- neulandFon (0421) 380107-30 Buero fuer Informatik Fax (0421) 380107-99 Konsul-Smidt-Str. 8g Mobil (0176) 20674323 28217 Bremen alexander.knoel...@neuland-bfi.de http://www.neuland-bfi.de Geschäftsführer: Thomas Koch Registergericht: Amtsgericht Bremen, HRB 23395 HB Steuer-Nr. 71-582/03051 USt-ID. DE 246585501 _ Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und löschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail und der darin enthaltenen Informationen sind nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
Re: parallel webapp initialization
On 09/10/2011 13:55, Alexander Knöller wrote: Hello mailing list. We use a single tomcat instance (soon switching from 5.5.23 to 7.x) with 24 webapps. Each webapp is based on spring and hibernate doing a lot of I/O during initialization. Tomcat is often restarted which causes long downtimes. As far as i can see the tomcat initializes its wepapps sequentially. So despite the fact, that our tomcat-intance runs on a 8 core linux system, tomcat seems to use a single thread to initalize the webapps. Is there a way on tomcat 7 to make it initialize webapps in parallel? Nope. Or is there a basic obstacle? Not that I can think of off the top of my head. Just that no-one has felt the need to scratch that particular itch. Both start and stop needs to be taken care of. If you want to propose a patch, this might provide a starting point: https://issues.apache.org/bugzilla/show_bug.cgi?id=46264 I've added some review comments to that patch that you may want to consider when writing a patch. If you need any help with the patch, just ask here. Thinking about this has got me interested. If you decide not to take a look at writing a patch for this, I'll probably take a look - maybe later this week. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: parallel webapp initialization
Alexander Knöller wrote: Hello mailing list. We use a single tomcat instance (soon switching from 5.5.23 to 7.x) with 24 webapps. Each webapp is based on spring and hibernate doing a lot of I/O during initialization. Tomcat is often restarted which causes long downtimes. As far as i can see the tomcat initializes its wepapps sequentially. So despite the fact, that our tomcat-intance runs on a 8 core linux system, tomcat seems to use a single thread to initalize the webapps. I'd love to see such patch as well, we have ~20 webaps with a total hundreds of megabytes of WAR files and full tomcat restart takes like 2 minutes on 24 thread machine with SSD storage subsystem. Some tuning options are needed as well, as webapp initialization can be IO bound on some storage so having more threads can actually make it slower ( once disk heads start moving... ). Good and safe default would be 1 init thread and max bound by cpus available in the system ? Regards, Darius. -- View this message in context: http://old.nabble.com/parallel-webapp-initialization-tp32619136p32620647.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Should Form Authentication Valve restore request body on a PUT?
On 1:59 PM, Nicholas Sushkin wrote: The bug was that if you do an unauthenticated POST, PUT, or DELETE, the Form Authentication valve was trying to do a POST, PUT, or DELETE to the login form. The correct behaviour IMHO is to always GET the login form and return it as a response to the unauthenticated request of any kind. Then, once the form is POSTed and authentication is successful, the original request whatever it may have been, should be replayed. Right? On Friday, October 07, 2011 16:07:20 Nicholas Sushkin wrote: Before being forwarded to login page, the request is saved and only then turned into GET, before dispatching the forward to the login page. After login form is submitted, the original request is restored from the saved state and is replayed. -- Nicholas Sushkin, Senior Software Engineer, Manager of IT Operations Open Finance - Secure, Accurate, Industrial Strength Aggregation http://www.openfinance.com Sounds logical but modifying data on the server: 1) after being diverted to the login form 2) without any type of confirmation makes me a little uncomfortable. -Terence Bandoian - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: parallel webapp initialization
-Original Message- From: Darius D. [mailto:darius@gmail.com] Sent: Sunday, October 09, 2011 1:26 PM To: users@tomcat.apache.org Subject: Re: parallel webapp initialization Alexander Knöller wrote: Hello mailing list. We use a single tomcat instance (soon switching from 5.5.23 to 7.x) with 24 webapps. Each webapp is based on spring and hibernate doing a lot of I/O during initialization. Tomcat is often restarted which causes long downtimes. As far as i can see the tomcat initializes its wepapps sequentially. So despite the fact, that our tomcat-intance runs on a 8 core linux system, tomcat seems to use a single thread to initalize the webapps. I'd love to see such patch as well, we have ~20 webaps with a total hundreds of megabytes of WAR files and full tomcat restart takes like 2 minutes on 24 thread machine with SSD storage subsystem. I'd like to see this as well. I'm running 3 servers, each with about 300 virtual hosts. Initialization varies from 1:40 to 4:00 depending upon how good the machine is. Some tuning options are needed as well, as webapp initialization can be IO bound on some storage so having more threads can actually make it slower ( once disk heads start moving... ). Good and safe default would be 1 init thread and max bound by cpus available in the system ? Regards, Darius. George Sexton MH Software, Inc. 303 438-9585 www.mhsoftware.com - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: two questions about the session timeout in tomcat
Hi Chris, Pid Geroge, Thanks to everyone who replied my mail. I try to answer your questions in one mail. 1. I access the admin interface by manager app. I'd like to have exist command to run and get the report easily, if there is no the command, I will think to use wget | crul. 2. The application with sessions under 60 normally has no issue. But when the session go up to 80 ~ 100, I start to get calls from the customer. It happens many times at random time. Sometime I have to restart it, without any changes, after restart, customer can continuous use it. This performance issue is very annoying. 3. From Chris explanation, looks to change the timeout to 30 minutes will be good idea, since I don't care of the end users to login the system more frequently, I need more stable system. The server has other heavy applications running, CPU load is always up to 10 ~ 20, available physical memory is not too much (10GB). 4. We are doing the troubleshooting on this application recently and don't find too much can be done. Check with network and DBA team, they all report me there is no issue. Contacted with Developers who maintain the tomcat app codes, they said the code running in their testing environment is fine. I am planned to do some load testing, but it is just in plan. 5. @ Pid: Can you explain me more detail on how to do with your suggestion, I am not developer, don't write codes, my role in this project is to setup the webserver, tomcat service and make it running and stable. *** The session count per application can be read via a JMX connection and a request to the appropriate MBean. *** 6. @ Geroge Sorry, I don't understand your question. We DO have Oracle Database in the backend. *** Are you storing objects on the session, in particular JDBC connections or result sets? *** Regards Bill On Sat, Oct 8, 2011 at 1:23 AM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Bill, On 10/6/2011 7:20 PM, Bill Wang wrote: Recently one of Tomcat application has performance issue, which get slow respond with high sessions. Can you give us some numbers? At what point do things slow down, and by how much do they slow down? One team member recommend me to adjust the session timeout from 60 minutes to 30 minutes. I will do that, but before change it, I'd like to understand how the performance related with the expire session timeout. session-timeout60/session-timeout I'm not sure performance will change at all when changing the session timeout. Tomcat runs session-expiration tasks periodically, and the performance of that has more to do with the number of total sessions than the timeout itself. If you have lots of sessions that must timeout instead of being explicitly invalidated (i.e. people close their browsers instead of logging-out), then you will have a lot of wasted memory that may prevent the garbage collector from working efficiently. It's best to destroy sessions as soon as they are not needed, so short session timeouts can help with that. On the other hand, you want to give users a reasonable amount of time to get a cup of coffee, etc. without forcing them to re-login every time. You'll have to determine what is an appropriate amount of time for your users. There is another option: selectively extend the session timeout for certain sessions, or for certain operations. If a user enters a flow that is expected to take a long time or the consequences of having the session time out are frustrating (i.e. you have to re-enter tons of data), you can change the session timeout for that one session to be longer than the default. When the flow is over, you can re-set it back to the default. We do that for a number of tasks in our webapp, for instance. Second, currently I monitor the session count by login the admin interface, Do you mean using the manager app? the manual way is not efficiency, can I run some commands to get the sessions number? With that I can set a cronjob and generate the session report easily. If you have the manager app deployed, you can use the text or XML interfaces from the command-line instead of the HTML interface. Simple use of wget, curl, etc. should allow you to do this kind of thing. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk6PC2gACgkQ9CaO5/Lv0PBo3gCgvV7dAylXSz1vz3jRX2jmr1lE E9kAoMKnHUgOC5MEx31lz121tXT1aV8J =CGz3 -END PGP SIGNATURE-