当 WebContainer 线程池 (WebSphere) 被完全使用并收到新请求时会发生什么?

What happens when WebContainer thread pool (WebSphere) is fully used and new request is received?

有关于 WebSphere 的问题,但在文档中找不到任何内容...

当 WebContainer 线程池被完全使用并收到新请求时会发生什么?我说的是当所有都被使用并且我们达到最大线程池大小时的情况,这意味着可能不会创建新线程池来处理请求。

请问: - 立即失败并且响应将包含某种错误? - WAS 会以某种方式 "queue" 给定时间段的请求并在其中一个线程返回池中时处理它?如果等待时间过长,可能还会出现某种error/timeout? - WAS 将 "queue" 无限期地请求并且超时可能只发生在用户端(网络 browser/app)?

确切的行为可能没有记录,因此可以在不同版本之间更改详细信息以改进行为。您可能可以通过查看 javacores 或从各种文档中收集信息来推断行为,例如 IBM WebSphere Application Server Performance Cookbook 文档的 BoundedBuffer 部分:

The thread pool request buffer is essentially a backlog in front of the thread pool. If the thread pool is at its maximum size and all of the threads are dispatched, then work will queue in the requestBuffer. The maximum size of the requestBuffer is equal to the thread pool maximum size; however, if the unit of work is executed on the thread pool with a blocking mode of EXPAND_WHEN_QUEUE_IS_FULL_ERROR_AT_LIMIT or EXPAND_WHEN_QUEUE_IS_FULL_WAIT_AT_LIMIT, then the maximum size is ThreadPoolMaxSize * 10. When the requestBuffer fills up, then WSVR0629I is issued (although only the first time this happens per JVM run per thread pool). When the requestBuffer is full, work will either wait or throw a ThreadPoolQueueIsFullException, depending on how the unit of work is executed.

实际上,这意味着在 maxThreads 个线程忙于执行工作后,额外的 maxThreads 个请求将在有界缓冲区中排队,当该缓冲区已满时,套接字线程将阻塞直到它可以排队工作,这意味着进一步的传入请求将被阻止,直到线程可用并在有界缓冲区中创建 space。