简体   繁体   English

限制Tomcat中servlet cpu的使用

[英]limit servlet cpu usage in tomcat

Some of my servlets will involve heavy procession and time-consuming. 我的一些servlet会涉及大量的处理过程和耗时的过程。 And other servlets are simple. 其他servlet很简单。 If the heavy servlet calls are very high in number, the simple servlets cannot be used. 如果繁重的servlet调用数量很高,则无法使用简单的servlet。 so, I want to limit the heavy servlets that it can use only up to 50% of the total CPU. 因此,我想限制繁重的servlet,使其最多只能使用总CPU的50%。 Is it possible? 可能吗? if so, please explain how/where to proceed in tomcat. 如果是这样,请解释如何/在哪里进行tomcat。

Capsulate the code away from the rest of the application as war 将代码与战争中的其他应用程序封装在一起

then 然后

create a secound instance of Tomcat and configure via the operating system the priority . 创建Tomcat的secound实例并configure via the operating system the priority

Ubuntu (Linux) system priority Ubuntu(Linux)系统优先级

or 要么

try to set threadPriority into the Executor (thread pool) in Tomcat 尝试将Executor (thread pool) in Tomcat threadPriority设置为Executor (thread pool) in Tomcat

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM