users@grizzly.java.net

performance of Grizzly FixedThreadPool

From: Jon Brisbin <jon_at_jbrisbin.com>
Date: Wed, 20 Jul 2011 16:08:22 -0500 (CDT)

I'm seeing a ton of CPU usage in org.glassfish.grizzly.threadpool.FixedThreadPool$BasicWorker.getTask() in my profiling (34%).

I'm doing 200,000 PUTs of 1MB of data within an 8 second time span (200 simultaneous users).

Here's a CSV of the profile results for this run:

"Name","Time (ms)","Samples"
"<All threads>","5931","100"
"java.lang.Thread.run()","5901","80"
"org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run()","5890","60"
"org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork()","5890","60"
"org.glassfish.grizzly.threadpool.FixedThreadPool$BasicWorker.getTask()","4292","34"
"org.glassfish.grizzly.utils.LinkedTransferQueue.take()","4292","34"
"org.glassfish.grizzly.utils.LinkedTransferQueue.xfer(Object, int, long)","4292","34"
"org.glassfish.grizzly.utils.LinkedTransferQueue.awaitFulfill(LinkedTransferQueue$QNode, LinkedTransferQueue$QNode, Object, int, long)","4292","34"
"java.util.concurrent.locks.LockSupport.park(Object)","4292","34"
"org.glassfish.grizzly.nio.SelectorRunner.run()","736","20"
"org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$1.run()","717","5"
"org.glassfish.grizzly.threadpool.AbstractThreadPool.onTaskDequeued(Runnable)","145","1"
"org.glassfish.grizzly.utils.DelayedExecutor$DelayedRunnable.run()","10","5"
"java.lang.Object.wait(long)","10","5"
"java.lang.ref.Finalizer$FinalizerThread.run()","22","5"
"java.lang.ref.Reference$ReferenceHandler.run()","7","5"
"com.mongodb.Mongo$DBCleanerThread.run()","0","5"
"com.intellij.rt.execution.application.AppMain.main(String[])","0","5"

The last two columns are time in ms and CPU%.

This is limiting my tests as the CPU usage is slowing down my server.

Thanks!

Jon Brisbin
http//jbrisbin.com