3

I have been using apache-tomcat-6.0.35 in production environment. Our application is hosted on Amazon EC2 using Small Instance. The problem we are facing is that the apache tomcat is using 100% CPU. We have verified it by running htop and it shows multiple threads of tomcat running.

Out application has been developed in Grails 2.0.1.

We are puzzled that why it is happening? Can any body suggest any solutions?

Thanks

Zunair Minhas
  • 145
  • 1
  • 7

2 Answers2

7

Probable Cause

Most likely this has been caused by the recent Leap Second and its impact on quite some unaware/unprepared IT systems, including parts of Linux, MySQL, Java and indeed Tomcat - see the Wired article about the ‘Leap Second’ Bug Wreaks Havoc Across Web for the whole story:

[...], saying it experienced the leap bug problem with the Java-happy Tomcat web servers it uses to serve up its site. “Our web servers running tomcat came close to zero response (we were able to handle some requests),” read an e-mail from a site spokesman. “We were able to connect to servers in order to reset them. Only rebooting the servers cleared up the issue.” [emphasis mine]

Workaround / Fix

Accordingly, the solution usually boils down to turning it off and on again, i.e. restarting the server in question, though you might be able to avoid this by simply setting the date, as suggested e.g. in the context of:

Background / Proposed Solutions

Please note that while the underlying issue is utterly tricky, it is all but unknown in principle, hence there have been prominent posts/users warning about and explaining this and offering suggestions on how to deal with it in principle, in particular:

Community
  • 1
  • 1
Steffen Opel
  • 63,899
  • 11
  • 192
  • 211
0

We can't say anything for sure with the information provided. For performance issue, I would recommend a profiler, especially JProfiler, to investigate the cause of this problem. By this way you will be able to locate where the problem is.

This program has a trial license, I think that's enough for a quick look.

UPDATE: after carefully read your question, I see that you have many tomcat instance running for a website? It means that the previous tomcat instances failed to stop; they still run and hog up all the resources. This is possible. You must kill all the old tomcat process before trying to start a new one.

You can kill the processes by hand by "kill -9 " if you are on Linux, before trying to start the server again.

Hoàng Long
  • 10,746
  • 20
  • 75
  • 124