---
title: Tomcat多用户请求连接超时的解决方法
description: "环境信息：CentOS 7.6、MySQL 5.7.26、Tomcat 8.5.32"
url: https://www.hikunpeng.com/document/detail/zh/kunpengwebs/troubleshooting/trouble/kunpengwebs_09_0021.html
sourcePath: /source/zh/kunpengwebs/troubleshooting/trouble/kunpengwebs_09_0021.html
indexId: 0d8a00f8200bcd9dc98b7d8c57254dfdcf22d7a2c41384760ef09fc9da2b3abf71
---
# Tomcat多用户请求连接超时的解决方法

#### 问题现象描述

环境信息：CentOS 7.6、MySQL 5.7.26、Tomcat 8.5.32

在压力测试服务器运行loadrunner时对应用服务器进行加压，可以验证被测系统在不同压力情况下的表现。在测试多用户连接时，连接数超过3个就会出现连接失败的情况。具体提示信息如下：

```
Action.c(10): Error -27796: Failed to connect to server "128.5.69.44:8082": [10048] Address already in useTry changing the registry valueHKEY LOCAL MACHINE\System\CurrentControlSet\Services\tcpip\Parameters\TcpTimedWaitDelay to 30 and HKEY LOCAL MACHINE\System\CurrentControlSet\Services\tcpip\Parameters MaxUserPort to 65534 and rebooting the machineSee the readme.doc file for more information
```


#### 关键过程、根本原因分析

负载生成器的卓越性能导致其发送数据包速度过快，使得服务器端口在未超时的情况下即被占满。


#### 结论、解决方案及效果

可以通过调整timeout参数来解决该问题。

1. 修改run time setting中的请求超时时间。
  建议在“Preferences”中点击“Options”，然后将HTTP-request connect timeout、HTTP-request receive timeout、Step download timeout三个参数分别修改为1000、1000、10000。

2. 将Browser Emulation中的Download non-HTML resources选项取消。
3. 在“Runtime Setting”>“Internet Protocol：Preferences”>“Advanced”区域中勾选“wininet replay instead of sockets”选项。
4. 重新测试多用户连接。
