Tomcat maxThreads&;用于快速失效的acceptCount调整
我希望将Tomcat调优为在所有线程都被占用的情况下出现任何问题时快速失败(例如,如果数据库突然开始执行不良,则等待数据库连接) 我查看了几篇文章,具体如下: 我有几个问题,如果您能帮助我,我将不胜感激:Tomcat maxThreads&;用于快速失效的acceptCount调整,tomcat,microservices,fail-fast,Tomcat,Microservices,Fail Fast,我希望将Tomcat调优为在所有线程都被占用的情况下出现任何问题时快速失败(例如,如果数据库突然开始执行不良,则等待数据库连接) 我查看了几篇文章,具体如下: 我有几个问题,如果您能帮助我,我将不胜感激: 为什么Netflix会将并发请求保存在内存中,然后在达到阈值时在自己的代码中回复503?这背后的理由是什么? 据我从tomcat文档(见上面的链接)了解,如果达到maxThreads和acceptCount,tomcat将以自己拒绝的连接进行回复。因此,正确指定较小的acceptCount应
任何帮助/建议都将不胜感激。您好,您是否以某种方式解决了此问题?我还尝试配置fail fast,我们正在应用程序中进行一些批处理,默认配置不好。不,我没有。我把它推迟了一点,也许下个星期会再讨论。如果我得到任何结果,我会写信的。嗨,你解决了这个问题吗?我还尝试配置fail fast,我们正在应用程序中进行一些批处理,默认配置不好。不,我没有。我把它推迟了一点,也许下个星期会再讨论。如果我得到任何结果,我会写信的。
# not using the executor, but a 'default' internal thread pool of the connector
maxConnections = -1 # For NIO/NIO2 only, setting the value to -1, will disable the maxConnections feature and connections will not be counted.
# or we can leave default, i.e. 10k. The thing is that only 1 thread ( hence little resources used ) will keep these connections alive, so we can use keepAlive
# and avoid establishing connections again and again which can be costly and resource consuming.
server.tomcat.max-threads = 96 # we assume that 8 cores can handle up to this amount of threads, given that each thread spends significant time in database and/or other network calls
# in the article above it was stated that they increased maxThreads 3 times than the amount of cores
server.tomcat.accept-count = ?? # from one point of view, it can be something really-really small like 16 or 32
# from another point of view, maybe something like 512
# imagine that due to a temporary network glitch an upstream service won't be reachable and we need few seconds to reach the timeouts and open circuit breaker. would be nice to queue other requests and successfully ( the ones what are independent ) process them seconds after rather than reject them right away