[GLASSFISH-16874] Faster restart time Created: 16/Jun/11  Updated: 04/Feb/13

Status: Reopened
Project: glassfish
Component/s: ide-integration
Affects Version/s: 3.1_b10
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: cowwoc Assignee: Tomas Kraus
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


The time it takes to shutdown Glassfish and restart it is extremely slow. It is at least an order of magnitude greater than Tomcat, Grizzly and Jetty.

There are two reasons I'd like to see this resolve:

  1. I am modifying JNI code between restarts: http://stackoverflow.com/questions/6333056/running-webapps-in-separate-processes
  2. I want a stripped-down servlet server. I don't use the rest of the J2EE stack and I don't want it loaded for no reason.

I expect to be able to restart Glassfish in 3 seconds or less. Remember, every time I modify the webapp I need to redeploy it by restarting the server. Anything longer than 3 seconds will seriously hamper development productivity.

Comment by Tim Quinn [ 16/Jun/11 ]

I see that you filed this as affecting release 3.1. Has your experience been the same with recent builds of 3.1.1?

If you want only a web container, you should try using the GlassFish Web distribution (instead of the full Java EE distribution) and see if that is faster for you.

On the GlassFish download site, navigate to the release you are interested in (for example, http://dlc.sun.com.edgesuite.net/glassfish/3.1.1/promoted/ for the latest builds of 3.1.1) and you'll see (again, for example)

latest-web-ml.zip 09-Jun-2011 14:06 56M
latest-web-unix-ml.sh 09-Jun-2011 14:08 38M
latest-web-unix.sh 09-Jun-2011 13:43 32M
latest-web-windows-ml.exe 09-Jun-2011 14:10 38M
latest-web-windows.exe 09-Jun-2011 13:44 32M
latest-web.zip 09-Jun-2011 13:41 44M

What specific release of GlassFish are you using (is it released 3.1 which is 3.1-b43)?

What times are you seeing for restart?

Comment by Hong Zhang [ 10/Oct/12 ]

Closed the RFE as there was no response from user (assuming the issue no longer exists).

Comment by cowwoc [ 10/Oct/12 ]

Please reopen this issue.

Using Glassfish 3.1.2 which ships with Netbeans 7.2 I get:

16 seconds to shut down
4 seconds to start up
A total of 20 seconds, whereas the stated goal is 3 seconds. Start-up time is very encouraging but it's not clear why shutdown takes so long.

Comment by Hong Zhang [ 10/Oct/12 ]

I have re-opened the issue based on your request. Can you provide some additional information so we can try to reproduce it from our side, what were the steps/applications you used?

Have you tried to use web profile as Tim suggested earlier to see if it makes a difference?

I am not sure why you would need to restart server each time after you redeploy application, that should not be necessary. Is this related to that you need to modify JNI code between restarts?

As this is more web app specific, I am reassigning to web team for them to further evaluate.

Comment by cowwoc [ 10/Oct/12 ]

To reproduce simply install Netbeans 7.2, open any web project, launch Glassfish, then hit the "restart" button to restart the server.

Yes. As stated above, I need to restart the server anytime I modify native code (because there is no other way to get Glassfish to unload it before loading a new instance of the webap).

Here is what I see for the web profile of Shutdown in 2 seconds, sleep for 13 seconds (nothing seems to be happening), Startup in 4 seconds. Looking back at the full version of 3.1.2 I see a similar behavior.

So, overall start/shutdown is roughly 6 seconds (not bad, but could certainly be improved) and it's not clear where this 13 second delay is coming from (is it Glassfish? is it the Netbeans plugin?)

Comment by vince kraemer [ 01/Feb/13 ]

this looks like it is more an ide integration issue than a web container issue.

I did some quick experiments with NB 7.2.1 and GF

1. restart server using restart menu item on server node: about 10 seconds.

2. restart using the restart button in the server logs output window: about 12 seconds

3. restart the server using asadmin stop-domain then start-domain : about 11 seconds

4. restart the server using asadmin restart-domain : about 6 seconds

It seems the IDE is using stop/start instead of restart-domain... There may be reasons for that choice, but it is worth looking at a second time.

Comment by cowwoc [ 01/Feb/13 ]

That might be part of the problem, but the other part is the 6 seconds you're seeing. 6 seconds is an eternity when you restart a server 100s of times a day. Like I said, anything above 3 seconds is bad (and even 3 seconds isn't great).

I ended up solving my problem by using Jetty (restart time under 1 second!) but clearly this isn't really a solution.

Comment by vince kraemer [ 04/Feb/13 ]

I agree. Once the restart from the IDE is going as fast as the server will allow, we can reassign the issue to the server to make their restart faster.

Generated at Sat Aug 27 21:19:32 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.