请说明tomcat执行器中参数maxQueueSize
的含义。
一个额外的问题 - 它是否链接到 tomcat 连接器中的 acceptCount
?
提前致谢。
最佳答案
这被很好地提及 here
Each incoming request requires a thread for the duration of that request. If more simultaneous requests are received than can be handled by the currently available request processing threads, additional threads will be created up to the configured maximum (the value of the maxThreads attribute). If still more simultaneous requests are received, they are stacked up inside the server socket created by the Connector, up to the configured maximum (the value of the acceptCount attribute). Any further simultaneous requests will receive "connection refused" errors, until resources are available to process them.
maxQueueSize :-在我们拒绝它们之前可以排队等待执行的可运行任务的最大数量。默认值为 Integer.MAX_VALUE
参数acceptCount与TCP队列有关。在这个队列中,操作系统可以保持一定数量的连接,即使它们不能立即处理。这个概念是特定于操作系统的——对于 Linux,您可以引用 here 来理解这一点。更多的见解是here .
maxQueueSize 是包含实际请求处理任务的队列,可由最多 maxThreads 个线程运行。它们实际上在队列中,因为处理线程的数量有限,任务在队列中花费一些时间,然后被执行器拾取并分配给一个空闲的线程来执行任务。
关于tomcat - tomcat 执行器中的解释 maxQueueSize,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30613474/