February 17, 2020

Win10: increase number of TCPIP connections

My workstation is several years old, but still pretty good -- it has Xeon process and 64GB ECC RAM.  It's still a good amount of memory for today's standard and I had this several years back.  Back then, I purchased this much of RAM for ML (Machine Learning) work and experiments.

Nowadays, not only ML, but I do a lot of reading, online courses, experimenting at the same time.  I often have 3 different browsers running with 100's of tabs (articles and videos), 3+ VMs with 2-5 heavy processes in each VM (e.g. Hadoop, RDBMS, NoSQL, MQ, etc).

I noticed some issues with internet connection after 1-2 days of running continuously, I can't connect to any more web sites -- it gets little better if I kill some browsers/tabs and shutdown VMs.  But once the problem starts, the problem remains.  Restarting certainly fix the problem.

It's pretty obvious that OS exhausted TCPIP connections, and I remembered I read somewhere that the limit is set in registry for windows.  So googled -- updated the registry and rebooted.  It's been only 1 day with light load -- so I'll see how it goes.

Increase TCPIP connections

  1. Open regedit
  2. Go to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters
  3. Find "TcpNumConnections", if it's not there, create one with DWORD
  4. Set value to 0x00fffffe or 16,777,214
Reboot.  This is for Windows 10 Pro, and should work for other versions.  Read reference article #1, if you want to tweak more.

Updated - additional Info

Update 3/1/2020 - after above change, it seems it's working.  At least I am able to connect more web sites.  However, I noticed it's slow.  I found more information that may help.  I'll have to see how it goes.

More Registry Tweaks

(from Reference #3)
Using regedit, change the value for this entry:
Max value is 65535

Additional helpful modification:

DisableIPSourceRouting = 2 (protects against packet spoofing)
EnableDeadGWDetect = 0 (disable; to avoid certain DOS attacks)
EnableICMPRedirect = 0 (disable; to avoid certain routing attacks)
KeepAliveTime = 300000 (5 minutes; implicit default is 1 hour)
TcpMaxDataRetransmissions = 4 (implicit default is 5)

Reset TCP/IP stack
(from Reference #4)

  1. Open cmd with administrator privilege.
  2. Type following:  netsh int ip reset

I am not sure if this makes it better though.  It feels like it - I have no technical evidence.


  1. http://smallvoid.com/article/winnt-tcpip-max-limit.html
  2. https://deploymentresearch.com/fix-for-windows-10-exhausted-pool-of-tcpip-ports/
  3. https://community.ipswitch.com/s/article/Avoiding-TCP-IP-Port-Exhaustion
  4. https://grok.lsu.edu/Article.aspx?articleid=19483 

No comments: