`
lj6684
  • 浏览: 955187 次
  • 性别: Icon_minigender_1
  • 来自: 长春
社区版块
存档分类
最新评论

Address already in use : connect 异常的解决办法

    博客分类:
  • Java
 
阅读更多

Java版C/S程序,作压力测试的时候发现当客户端连续创建连接一段时间后报

 

Address already in use : connect ...... 乱七八糟一堆异常

 

再尝试建立连接已经连不上了,通过 netstat -a 命令查看,有一大堆状态为 TIME_WAIT 的占用连接不被释放

 

网上查到很多这类问题解决办法

 

问题原因:

Java的 Socket.close() 并不能立即释放连接,会造成一段时间内 TIME_WAIT 的状态

操作系统可供使用的连接数有默认限制,很快会被占满

 

解决办法

1. Tomcat中Connector配置里增加辅助参数(经验证无效

 

<Connector
  ...
  minProcessors="75" 
  maxProcessors="1024"
  acceptCount="1024"
  enableLookups="false"      
  connectionTimeout="30000"
/>

 

2. 修改操作系统注册表(经验证能够解决问题

 

1、打开注册表:regedit
2
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Services\TCPIP\Parameters
3
、新建 DWORD值,nameTcpTimedWaitDevalue30(十进制) –> 设置为30秒,默认是240
4
、新建 DWORD值,nameMaxUserPortvalue65534(十进制) –> 设置最大连接数65534
5
、重启系统

 

分享到:
评论

相关推荐

    Jmeter性能测试几点注意

    jmeter+oracle,阶段性加压,jmeter 压测客户端出现address already in use:connect处理

    解除Windows系统对JMeter压测工具连接数限制

    使用JMeter压测时,报java.net.bindexception:address already is use:connect异常,可执行本资源的.bat文件,修改系统注册表。

    计算机网络第六版答案

    An Internet Exchange Points (IXP) (typically in a standalone building with its own switches) is a meeting point where multiple ISPs can connect and/or peer together. An ISP earns its money by ...

    S7A驱动720版本

    - The information field "Device in use" has been added to the device statistic display. This shows which device (primary or backup-device) is currently active. This state can also be requested via...

    Java邮件开发Fundamentals of the JavaMail API

    your program to use IMAP instead of POP and expect everything in IMAP to be supported. Assuming your mail server supports IMAP, your JavaMail-based program can take Fundamentals of the JavaMail API...

    CISCO 技术大集合

    Is this interface in use? [yes]: 2) 是否设置此接口的IP参数: Configure IP on this interface? [yes]: 3) 设置接口的IP地址: IP address for this interface: 192.168.162.2 4) 设置接口的IP子网掩码: ...

    Microsoft Windows 7 In Depth.pdf

    Thank you for purchasing or considering the purchase of Windows 7 In Depth. It’s amazing the changes that 20-odd years can bring to a com- puter product such as Windows. When we wrote our first ...

    JLink_Windows_V648.zip

    DLL: JTAG: When only having 1 TAP in the JTAG chain and its matches the one for the configured CPU core but the TAP-ID was unknown, connect did not work. Fixed. DLL: Linux: Delayed / slowed execution ...

    Radmin自动登录器v3.0-多国语言绿色版-Release1-20150615

    若由于配置混乱、异常关闭等原因导致程序运行后无法显示主窗口,可以先备份然后删除RadminM.ini文件即可正常运行。 (2)、多种语言支持 本程序使用INI文件实现多种语言支持,每种语言信息用一个扩展名为lng的INI...

    XDA成员开发出Carrier IQ检测程序(Android)

    The checking part of the app will always be free here but because of the time it took me to universally code the removal and because we already have documented 100000 ways to do it yourself (see post...

    猎头系统 C# ( 人才求职招聘)

    In the Connect to box, click Connect to .... In the Open Web Site dialog box, click the FTP Sites tab. Type the FTP address of your server, and if required, the user name and password that your ...

    EhLib5.0.13 最新的ehlib源码

    and use PrinterPreview.Handle in functions that return information about printer facilities (GetDeviceCaps, e.t.c.). Global function PrinterPreview returns default PrinterPreview object and shows ...

    EhLib 9.1.024

    and use PrinterPreview.Handle in functions that return information about printer facilities (GetDeviceCaps, e.t.c.). Global function PrinterPreview returns default PrinterPreview object and shows ...

    Radmin自动登录器v3.0

    若由于配置混乱、异常关闭等原因导致程序运行后无法显示主窗口,可以先备份然后删除RadminM.ini文件即可正常运行。 (2)、多种语言支持 本程序使用INI文件实现多种语言支持,每种语言信息用一个扩展名为lng的INI...

    ehlib_vcl_src_9_3.26

    and use PrinterPreview.Handle in functions that return information about printer facilities (GetDeviceCaps, e.t.c.). Global function PrinterPreview returns default PrinterPreview object and shows ...

    php.ini-development

    If you use constants in your value, and these constants belong to a ; dynamically loaded extension (either a PHP extension or a Zend extension), ; you may only use these constants *after* the line ...

    EhLib 6.3 Build 6.3.176 Russian version. Full source included.

    and use PrinterPreview.Handle in functions that return information about printer facilities (GetDeviceCaps, e.t.c.). Global function PrinterPreview returns default PrinterPreview object and shows ...

    EhLib 8.0 Build 8.0.023 Pro Edition FullSource for D7-XE8

    and use PrinterPreview.Handle in functions that return information about printer facilities (GetDeviceCaps, e.t.c.). Global function PrinterPreview returns default PrinterPreview object and shows ...

    TICQClient Version

    This example shows easy of use of the TICQClient component.[+] Changed AddContact(UIN: LongWord) procedute to AddContact(UIN: LongWord): Boolean function, it returns True when user is added to the ...

    微软内部资料-SQL性能优化3

    To make use of either more or less strict isolation levels in applications, locking can be customized for an entire session by setting the isolation level of the session with the SET TRANSACTION ...

Global site tag (gtag.js) - Google Analytics