Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] maxQueued

I'll start with the JMX part of the question first.

https://github.com/eclipse/jetty.project/blob/jetty-7.6.5.v20120713/jetty-jmx/src/main/resources/org/eclipse/jetty/util/thread/jmx/QueuedThreadPool-mbean.properties

Looks like the maxQueued attribute is not exposed.
That's a bug, filed an issue against it -> https://bugs.eclipse.org/bugs/show_bug.cgi?id=422137

As for the rest of the question...
We had too many issues with ArrayBlockingQueue, we removed support for maxQueued and the ArrayBlockingQueue from QueuedThreadPool starting in Jetty 9.
It started out as a performance question, then part of our mechanical sympathy efforts.
https://webtide.intalio.com/2013/01/jetty-9-goes-fast-with-mechanical-sympathy/

Eventually, some performance tests were run ...
https://github.com/eclipse/jetty.project/blob/jetty-9.1.0.v20131115/jetty-util/src/test/java/org/eclipse/jetty/util/QueueBenchmarkTest.java#L72

And we determined that the ArrayBlockingQueue performs some harsh JDK locking that actually hurts performance.
So we removed it as part of our Queue/ThreadPool cleanup
https://bugs.eclipse.org/bugs/show_bug.cgi?id=403591

However, we also made Jetty 9 use the built-in java.util.concurrent techniques.
Which allowed us to even expose that entire framework as an option for developers to use as the ThreadPool for jetty.
https://github.com/eclipse/jetty.project/blob/jetty-9.1.0.v20131115/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ExecutorThreadPool.java#L66-L77

The wiki about high load doesn't mention the maxQueued configuration for QueuedThreadPool, as that's not related to high load in our minds.
It would be like trying to improve the performance of an F1 racer by changing the length of the spark plug wires.


--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts


On Tue, Nov 19, 2013 at 6:22 PM, Chris Berry <cberry@xxxxxxxxxxxx> wrote:
Greetings,

I want to use maxQueued in the <server> config.
And I'm pretty certain I have it setup properly in my jetty.xml
(Note: I DO see my other settings confirmed in the JMX MBean)

<Configure id="Server" class="org.eclipse.jetty.server.Server">
    <Set name="ThreadPool">      <New class="org.eclipse.jetty.util.thread.QueuedThreadPool">        <Set name="name">Jetty</Set>
        <Set name="maxQueued"><Property name="jetty.maxQueued" default="-1"/></Set>
        <Set name="minThreads"><Property name="jetty.minThreads" default="10"/></Set>
        <Set name="maxThreads"><Property name="jetty.maxThreads" default="200"/></Set>
        <Set name="detailedDump">false</Set>
      </New>
    </Set>

I read the source code, and as far as I can tell, by defining "maxQueued" I should get an ArrayBlockingQueue created.
But see no way to confirm that I actually got this right.

When I look at JMX, I see no mention of "maxQueued" -- whether I define it or not.

BTW: this doc: http://wiki.eclipse.org/Jetty/Howto/High_Load  makes no mention of "maxQueued".
This seems odd, as "maxQueued" is a more concise method to accomplish this.

But even when I try the method in that doc — by defining the ArrayBlockingQueue directly.
I still see no mention of "maxQueued" in the JMX

So my questions.
  1. Is there something wrong with my XML?
  2. How can I check my work here and confirm that I am in fact using an ArrayBlockingQueue?
  3. Why doesn't the JMX MBean (org.eclipse.jetty.util.thread:type=queuedthreadpool,id=0)  expose "maxQueued"? 
Thanks very much,
-- Chris 

I am using Jetty 7.6.5.v20120716






_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users



Back to the top