Tomcat中的多个java进程 [英] Multiple java processes in Tomcat

查看:66
本文介绍了Tomcat中的多个java进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个部署在 Tomcat 服务器中的基于 Web 的应用程序.在我们的本地开发环境中,当我们启动 Tomcat 服务器时,它只会产生一个持续运行的 java 进程.但是,在生产中报告了一个问题,即 java 进程的 CPU 使用率上升并且产生了多个 java 进程.

I am working on a web-based application which is deployed in the Tomcat server. In our local dev enviroemt, when we start the Tomcat server it spawns only one java process which keeps running. However, an issue has been reported in production where the CPU usage for java process has gone up and there are multiple java processes which have been spawned.

没有其他 java 应用程序在运行,所以这肯定是从 Tomcat 本身产生的.在我们的开发环境中只有一个java进程,而在生产环境中Tomcat产生了多个java进程是什么原因,如何解决.

There is no other java application running, so this must have been spawned from Tomcat itself. What is the reason that in our development enviroment there is only one java process while in production multiple java processes have been spawned by Tomcat and how to correct it.

问候,开发

推荐答案

您看到的很可能是生产盒上 top 或 ps 版本显示的多个线程,而您在本地盒上看不到它们.

What you see are most likely multiple threads that the version of top or ps shows on the production box, while you don't see them on the local one.

在生产环境中,您很可能面临更高的工作负载,因此请求是并行处理的,而在本地机器上,Tomcat 的线程更少.

In production you most likely face a much higher workload, so that requests are served in parallel, while on the local box Tomcat gets away with less threads.

这篇关于Tomcat中的多个java进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆