DelphiFan Magazine

Top Menu

Main Menu

  • DELPHI
  • CODE SAMPLES
  • FIREMONKEY
  • DATABASE
  • RELEASES
  • VIDEOS
  • REVIEW
  • TECH NEWS

logo

DelphiFan Magazine

  • DELPHI
  • CODE SAMPLES
  • FIREMONKEY
  • DATABASE
  • RELEASES
  • VIDEOS
  • REVIEW
  • TECH NEWS
  • How to add a server application written in UNIGUI to startup?

  • UniGUI Expiry Link Anonymizer

  • UniGUI Add CAPTCHA to the WEB project

  • UniGui. Unique hybrid of Delphi and JS

  • How to transform a blob field into string lines (varchar) in SQL Firebird?

CODE SAMPLESTECH NEWS
Home›CODE SAMPLES›How to modify the maximum number of tcp connections on the windows server

How to modify the maximum number of tcp connections on the windows server

By admin
October 9, 2020
384
0
Share:

When doing performance testing, if the system page being tested is simple and has good performance, this will result in insufficient tcp links on the press and cause the following errors:

HKEY_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 machine
See the readme.doc file for more information

The most introduced through Baidu search is to modify the two values of TimedWaitDelay and MaxUserPort. Among them, it is a relatively small point to modify TimedWaitDelay, which can be determined according to the actual situation.

At the same time, modify the value of MaxUserPort to be larger, but after the modification and restart the machine, the problem still exists. Check the information through multiple parties, and then modify some registry:

[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \Tcpip \Parameters]
TcpNumConnections = 0x00fffffe (Default = 16,777,214)


The above registry information configures the maximum number of TCP connections allowed for a single machine, and the default is 16M. This value seems to be very large. This is not the only condition that limits the maximum number of connections. There are other conditions that limit the maximum number of TCP connections.
Maximum number of dynamic ports
When a TCP client connects to a server, the client must allocate a dynamic port. By default, the allocation range of this dynamic port is 1024-5000, which means that by default, the client can initiate up to 3977 Socket connections at the same time. We can modify the following registry to adjust the range of this dynamic port

[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \Tcpip \Parameters]
MaxUserPort = 5000 (Default = 5000, Max = 65534)

Maximum number of TCB

The system allocates a TCP control block (TCP control block or TCB) for each TCP connection. This control block is used to buffer some parameters of the TCP connection. Each TCB needs to allocate a 0.5 KB pagepool and 0.5 KB Non-pagepool, which means In other words, each TCP connection will occupy 1KB of system memory.

The maximum number of TCBs in the system is determined by the following registry settings
[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Services \Tcpip \Parameters]
MaxFreeTcbs = 2000 (Default = RAM dependent, but usual Pro = 1000, Srv=2000)

For non-Server version, the default value of MaxFreeTcbs is 1000 (more than 64M physical memory)

Server version, the default value for this is 2000.

In other words, by default, the Server version can establish and maintain up to 2000 TCP connections at the same time.
Maximum number of TCB Hash tables

TCB is managed by Hash table, the following registry setting determines the size of this Hash table

HKEY_LOCAL_MACHINE \System \CurrentControlSet \services \Tcpip \Parameters]
MaxHashTableSize = 512 (Default = 512, Range = 64-65536)

This value indicates the amount of pagepool memory allocated, that is, if MaxFreeTcbs = 1000, then the amount of pagepool memory is 500KB

Then MaxHashTableSize should be greater than 500. The larger the number, the higher the redundancy of the Hash table, and the less time it takes to allocate and find TCP connections each time. This value must be a power of 2, and the maximum is 65536.

 MaxUserPort = 65534 (Decimal)
 MaxHashTableSize = 65536 (Decimal)
 MaxFreeTcbs = 16000 (Decimal)

Here we can see that MaxHashTableSize is configured to be 4 times larger than MaxFreeTcbs, which can greatly increase the speed of TCP establishment.

Tagsdelphitcptcp connectiontcp windowswindows server
Previous Article

Implementation of uniGUI login-free

Next Article

How to set up Unigui to run ...

0
Shares
  • 0
  • +
  • 0
  • 0
  • 0
  • 0

admin

Related articles More from author

  • CODE SAMPLESDELPHI

    How create a new uniGUI application

    November 8, 2020
    By admin
  • DELPHIREVIEW

    Ultimate Robust SecureBridge SSH

    September 29, 2020
    By admin
  • CODE SAMPLESDELPHIFIREMONKEY

    Delphi Android permissions

    December 4, 2020
    By admin
  • CODE SAMPLESDELPHI

    Showing “wait” screen for time-consuming processes

    January 3, 2021
    By admin
  • DELPHIFIREMONKEY

    Delphi Android integrates ZXing Barcode

    October 31, 2020
    By admin
  • CODE SAMPLESDELPHI

    Several Delphi programs for obtaining Windows system information

    November 23, 2020
    By admin

Leave a reply Cancel reply

You may interested

  • CODE SAMPLESDELPHI

    How to Remove Blank Lines from Memo?

  • CODE SAMPLESDELPHI

    Amazing Cross Platform Email App Sample In Delphi 10.4.1 FireMonkey For Android And IOS

  • CODE SAMPLESDELPHI

    UniGUI Expiry Link Anonymizer

  • LATEST REVIEWS

  • TOP REVIEWS

Timeline

  • January 27, 2021

    How to add a server application written in UNIGUI to startup?

  • January 27, 2021

    UniGUI Expiry Link Anonymizer

  • January 26, 2021

    UniGUI Add CAPTCHA to the WEB project

  • January 26, 2021

    UniGui. Unique hybrid of Delphi and JS

  • January 13, 2021

    How to transform a blob field into string lines (varchar) in SQL Firebird?

Latest Comments

Find us on Facebook

Follow Us on Instagram

logo

Our website, law, laws, copyright and aims to be respectful of individual rights. Our site, as defined in the law of 5651 serves as a provider of space. According to the law, contrary to the law of site management has no obligation to monitor content. Therefore, our site has adopted the principle of fit and remove. Works are subject to copyright laws and is shared in a manner that violated their legal rights, or professional associations, rights holders who, adsdelphi@gmail.com I can reach us at e-mail address. Complaints considered to be infringing on the examination of the content will be removed from our site.

About us

  • 660 Pennsylvania Avenue Southeast #100 Washington, DC 20003
  • 0123456789
  • adsdelphi@gmail.com
  • Recent

  • Popular

  • Comments

  • How to add a server application written in UNIGUI to startup?

    By admin
    January 27, 2021
  • UniGUI Expiry Link Anonymizer

    By admin
    January 27, 2021
  • UniGUI Add CAPTCHA to the WEB project

    By admin
    January 26, 2021
  • UniGui. Unique hybrid of Delphi and JS

    By admin
    January 26, 2021
  • How to add a server application written in UNIGUI to startup?

    By admin
    January 27, 2021
  • Amazing Cross Platform Email App Sample In Delphi 10.4.1 FireMonkey For Android And IOS

    By admin
    August 13, 2020
  • Critical Update Available For Delphi FireMonkey 10.4.1 On Android, IOS, OSX, Windows, And Linux

    By admin
    September 4, 2020
  • Setting up the IDE for your first Android Application in Delphi

    By admin
    September 7, 2020

Follow us

Find us on Facebook

© Copyright Delphifan Forum. All rights reserved.