简体   繁体   English

为多个同时的SOAP请求配置Tomcat

[英]Configure Tomcat for multiple simultaneous SOAP requests

I'm very much a Tomcat newbie, so I'm guessing that the answer to this is pretty straightforward, but Google is not being friendly to me today. 我非常是Tomcat的新手,所以我猜想答案很简单,但是Google今天对我并不友好。

I have a Java web application mounted on Apache Tomcat. 我在Apache Tomcat上安装了Java Web应用程序。 Whilst the application has a front page (for diagnostic purposes), the application is really all about a SOAP interface. 尽管该应用程序具有首页(出于诊断目的),但该应用程序实际上仅涉及SOAP接口。 No client will ever need to look up the server's web page. 没有客户端将永远不需要查找服务器的网页。 The clients send SOAP requests to the server, which parses the requests and then looks up results in a database. 客户端将SOAP请求发送到服务器,服务器将解析请求,然后在数据库中查找结果。 The results are then passed back to the clients, again over SOAP. 然后将结果再次通过SOAP传递回客户端。

In its default configuration, Tomcat appears to queue requests. 在其默认配置中,Tomcat似乎将请求排队。 My experiment consisted of installing the client on two separate machines pointing at the same server and running a search at exactly the same time (well, one was 0.11 seconds after the other, but you get the picture). 我的实验包括将客户端安装在指向同一台服务器的两台不同的计算机上,并在完全相同的时间运行搜索(嗯,一台比另一台晚了0.11秒,但您可以看到图片)。

How do I configure the number of concurrent request threads? 如何配置并发请求线程数? My ideal configuration would be to have X request threads, each of which recycles itself (ie calls destructor and constructor and recycles its memory allocation) every Y minutes, or after Z requests, whichever is the sooner. 我的理想配置是让X个请求线程每隔Y分钟或在Z请求之后(以较早者为准)自动回收自身(即调用析构函数和构造函数并回收其内存分配)。 I'm told that one can configure IIS to do this (although I also have no experience with IIS), but how would you do this with Tomcat? 有人告诉我可以配置IIS来做到这一点(尽管我也没有IIS的经验),但是如何使用Tomcat来做到这一点?

I'd like to be able to recycle threads because Tomcat seems to be grabbing memory when a request comes in and not releasing it, which means that I get occasional (but not consistent) Java Heap Space errors when we are approaching the memory limit (which I have already configured to be 1GB on a 2GB server). 我希望能够回收线程,因为当请求进入时Tomcat似乎正在抢占内存而不释放它,这意味着在接近内存限制时,我偶尔会(但不一致)出现Java堆空间错误(我已经将其配置为2GB服务器上的1GB)。 I'm not 100% sure if this is due to a memory leak in my application, or just that the tools that I'm using use a lot of memory. 我不确定这是否是由于我的应用程序中的内存泄漏引起的,还是我正在使用的工具使用了大量的内存,我不是100%确定。

Any advice would be gratefully appreciated. 任何建议将不胜感激。

Thanks, Rik 谢谢,瑞克

Tomcat, by default, can handle up to 150 concurrent HTTP requests - this is totally configurable and obviously varies depending on your server spec and application. Tomcat默认情况下最多可以处理150个并发HTTP请求-这是完全可配置的,并且显然会因服务器规格和应用程序而异。

However, if your app has to handle 'bursts' of connections, I'd recommend looking into Tomcat's min and max "spare" threads. 但是,如果您的应用程序必须处理“突发”连接,则建议您查看Tomcat的最小和最大“备用”线程。 These are threads actively waiting for a connection. 这些是正在积极等待连接的线程。 If there aren't enough waiting threads, Tomcat has to allocate more (which incurs a slight overhead), so you might see a delay. 如果没有足够的等待线程,则Tomcat必须分配更多的线程(这会产生少量开销),因此您可能会看到延迟。

Also, have a look at my answer to this question which covers how to configure the connector: 另外,请看一下我对这个问题的回答,其中涵盖了如何配置连接器:

Tomcat HTTP Connector Threads Tomcat HTTP连接器线程

In addition, look at basic JVM tuning - especially in relation to heap allocation overhead and GC pause times. 另外,请看一下基本的JVM调整-特别是在堆分配开销和GC暂停时间方面。

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

相关问题 Tomcat上的Soap请求出错 - Error with soap requests on tomcat 如何在一个应用程序中处理多个同时出现的用户请求 - how to handle multiple simultaneous user requests in an application 如何使用Tomcat设置servlet可以处理的最大并发请求数 - How to set the maximum simultaneous requests that can be handled by a servlet using Tomcat 如何配置与 Spring 集成的嵌入式 Tomcat 以侦听对多个 IP 地址的请求? - How to configure embedded Tomcat integrated with Spring to listen requests to multiple IP addresses? 配置tomcat会话管理器以忽略特定请求 - Configure a tomcat session manager to ignore particular requests Tomcat 8配置多个SSL连接器 - Tomcat 8 configure multiple SSL connectors 如何为多个并发事务请求正确处理 JPA ObjectOptimisticLockException? - How to handle JPA ObjectOptimisticLockException properly for multiple simultaneous transaction requests? 如何编程以处理来自不同客户端的多个同时请求? - How to program to handle multiple simultaneous requests from different clients? 当两个同时发出的请求来自同一个ip时,Tomcat的行为 - Tomcat's behaviour when two simultaneous requests come from same ip 在一个数据包中发送多个SOAP请求 - Sending multiple SOAP requests in one packet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM