How do I prevent Socket/Port Exhaustion?

前端 未结 5 1956
被撕碎了的回忆
被撕碎了的回忆 2020-12-09 04:56

I am attempting to performance test a website by hitting it with requests across multiple threads. Each thread executes n times. (in a for loop)

However, I

5条回答
  •  醉梦人生
    2020-12-09 05:36

    Q: How do I explicitly close a socket ... in order to prevent TIME_WAIT states?

    A: Dude, TIME_WAIT is an integral - and important! - part of TCP/IP itself!

    You can tune the OS to reduce TIME_WAIT (which can have negative repercussions).

    And you can tune the OS to increase #/ephemeral ports:

    • http://msdn.microsoft.com/en-us/library/aa560610%28v=bts.20%29.aspx

    Here's a link on why TIME_WAIT exists ... and why it's a Good Thing:

    • http://www.serverframework.com/asynchronousevents/2011/01/time-wait-and-its-design-implications-for-protocols-and-scalable-servers.html

提交回复
热议问题