3

I am trying to find the bottleneck of a multithreaded service. I used ab with -c 100 and observed TPS around 350. The question is the peak CPU usage is 70%, memory is 10%. So it looks like it's not CPU or memory bound. It's not doing disk or network I/O. How do I determine what the bottleneck is?

vaultah
  • 44,105
  • 12
  • 114
  • 143
extraeee
  • 3,096
  • 5
  • 27
  • 28
  • Can you add some details about the process? The fact that you say there is no disk or network I/O seems a bit off. – ChaosPandion Jun 28 '10 at 19:34
  • basically the service spawns off 6 threads (using ExecutorSevice pool) to perform 6 reads from cache for each incoming request. I am using ehcache and only accessing 4 resources. I verified that except for the first pass all accesses are cache hits. The resources are of really small size, 5kb max. I used JProfiler and see 90% of the time spent in sun.misc.unsafe.park, the other 10% is my method. How should I interpret this/debug further? – extraeee Jun 29 '10 at 05:38

1 Answers1

1

Do you have threads in deadlock waiting for each other to finish? Do you have threads waiting on database locks? Waiting threads can often be a bottleneck in that the system appears to slow down or wait, but you won't always see resources consumed.

Chris Aldrich
  • 1,904
  • 1
  • 22
  • 37
  • @MaasSql - I know it is ridiculous expensive but the VS2010 profiler has some awesome features that can help you find dead-locks. – ChaosPandion Jun 28 '10 at 19:46
  • As ChaosPandion noted you need to use a profiler (or potentially a code debugger that may show the threading). But the profiler is the best way to go. Without knowing what system is being used or what language it is harder to recommend a profiler tool. At my company, we tend to stick to Java and IBM stack products, so we stick to IBM profilers. Hope this was helpful. – Chris Aldrich Jun 28 '10 at 19:58