当我的WebApp获得很多同时连接时,我正在遇到一些问题(即服务开始时)。
我期望在一定程度上的级别上让tomcat回答说他不能接受更多,通过回答代码503 的错误。
我已经阅读了文档并理解(我希望) maxthreads , acceptcount 和 maxConnections 。
我还阅读了很多帖子:
,但即使将MaxThreads设置为1。
当我发现有关如何解决503期问题的许多帖子时,我显然缺少一些东西...有人可以帮忙吗?
I am experiencing some issues when my webapp is getting lots of simultaneous connections (ie. when the service is starting).
I am expecting at a certain level of charge to have tomcat answer that he can't take more, by answer an error with code 503.
I have read the documentation and understood (I hope) the usage of maxThreads, acceptCount and maxConnections.
I also read lots of posts:
but I was not able to reproduce a tomcat answering 503, even by setting maxThreads to 1.
As I find lots of posts on how to solve 503 issues, I am obviously missing something... Can anyone help?
发布评论
评论(1)
当试图直接连接到tomcat时,我看到了同样的事情。
我长期以来使用Apache Httpserver作为Tomcat的前端,当所有可用的过程和线程耗尽时,都可以看到503。我期望看到一些方法至少可以配置为拒绝其他并发。
从我对源代码的天真阅读中,我也看不到由于并发请求而导致的503是如何发生的。
当我尝试通过限制连接器(即最小化线程,接受计数和最大连接),将睡眠放入测试JSP页面,并使用大量并发请求键入该页面时 - 我得到客户端时副暂停,但没有503。
I am seeing the same thing when trying to connect directly to Tomcat.
I've long used Apache HttpServer as a front-end to Tomcat and seen 503 when all available processes and threads are exhausted. I'd expect to see some means by which Tomcat can at least be configured to reject additional concurrency.
From my naive reading of the source code I also can't see how 503's occur due to concurrent requests.
And when I try to force 503's from a test environment by constraining the connector (i.e. minimizing threads, accept count, and max connections), putting sleeps in a test JSP page, and hitting that page with lots of concurrent requests -- I get client side timeouts but no 503's.