Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance drop after 5 days running web application, how to spot the bottleneck?

I've developed a web application using the following tech stack:

  • Java
  • Mysql
  • Scala
  • Play Framework
  • DavMail integration (for calender and exchange server)
  • Javamail
  • Akka actors

On the first days, the application runs smoothly and without lags. But after 5 days or so, the application gets really slow! And now I have no clue how to profile this, since I have huge dependencies and it's hard to reproduce this kind of thing. I have looked into the memory and it seems that everything its okay.

Any pointers on the matter?

like image 478
José Leal Avatar asked Aug 22 '11 11:08

José Leal


3 Answers

Try using VisualVM - you can monitor gc behaviour, memory usage, heap, threads, cpu usage etc. You can use it to connect to a remote VM.

like image 184
axel22 Avatar answered Sep 27 '22 20:09

axel22


`visualvm˙ is also a great tool for such purposes, you can connect to a remote JVM as well and see what's inside.

I suggest you doing this:

  • take a snapshot of the application running since few hours and since 5 days
  • compare thread counts
  • compare object counts, search for increasing numbers
  • see if your program spends more time in particular methods on the 5th day than on the 1str one
  • check for disk space, maybe you are running out of it
like image 33
jabal Avatar answered Sep 27 '22 19:09

jabal


jconsole comes with the JDK and is an easy tool to spot bottlenecks. Connect it to your server, look into memory usage, GC times, take a look at how many threads are alive because it could be that the server creates many threads and they never exit.

like image 34
Denis Tulskiy Avatar answered Sep 27 '22 18:09

Denis Tulskiy