Measuring the number of queued requests for tomcat

前端 未结 2 890
一整个雨季
一整个雨季 2021-02-13 12:29

So with tomcat you can set the acceptCount value (default is 100) which means when all the worker threads are busy - new connections are placed in a queue (until it is full, aft

2条回答
  •  北海茫月
    2021-02-13 12:50

    This thread on the mailing list and the reply from Charles suggests that no such JMX exists.

    Quote from Chuck: "Note that the accept queue is not visible to Tomcat, since it's maintained by the comm stack of the OS."

    Quote from David : "Unfortunately, since Tomcat knows nothing about the requests in the accept queue,...."

    Is there no way to get this information (How much requests are in the accept queue?) out?

    No, the accept queue is completely invisible. Only the comm stack knows anything about it, and there are no APIs I'm aware of to queue the contents - because the content hasn't been received yet, only the connection request.

    Depending on what your real problem is (i.e. for measuring requests in the accept queue which Tomcat has not yet begun procesing) if you're looking at a "throttling solution" see this follow-up on the same thread.

提交回复
热议问题