Google for "
Avoid TCP/IP Port Exhaustion" if you need more information on that subject. You will find that there is a lot of information about this already on the internet.
You may also want to take a look at TXT files in the "Help\Config" folder included in the RTC SDK.
I don't know how many domains you need to grade, nor what you are doing in order to grade a domain, but there is no need for you to invest much time in testing performance until your project is close to completion. And the only thing you need to test, is how much time it takes on average to grade a single domain, when using each of the supported methods. To get accurate results, I'd say you need to run the same test 100 times on a few domains, using these settings:
1. Async WinSock in Single-threaded mode:
MultiThreaded:=False;
Blocking:=False;
useProxy:=False;
UseWinHTTP:=False;
2. Blocking WinSock in Single-threaded mode:
MultiThreaded:=False;
Blocking:=
True;
useProxy:=False;
UseWinHTTP:=False;
3. WinHTTP in Single-threaded mode:
MultiThreaded:=False;
Blocking:=False;
useProxy:=False;
UseWinHTTP:=
True;
4. WinInet in Single-threaded mode:
MultiThreaded:=False;
Blocking:=False;
useProxy:=
True;
UseWinHTTP:=False;
5. Async WinSock in Multi-threaded mode:
MultiThreaded:=
True;
Blocking:=False;
useProxy:=False;
UseWinHTTP:=False;
6. Blocking WinSock in Multi-threaded mode:
MultiThreaded:=
True;
Blocking:=
True;
useProxy:=False;
UseWinHTTP:=False;
7. WinHTTP in Multi-threaded mode:
MultiThreaded:=
True;
Blocking:=False;
useProxy:=False;
UseWinHTTP:=
True;
8. WinInet in Multi-threaded mode:
MultiThreaded:=
True;
Blocking:=False;
useProxy:=
True;
UseWinHTTP:=False;
Each API has its downsides and upsides.
The WinInet API has a built-in connection pool, but limits the number of outgoing connections per domain to 3 per outgoing domain/IP. This shouldn't be a problem for you, though, since you will have a lot of domains to choose from, so you would be better off using a single physical connection per domain, until you have finished all behcnmarks for that domain and have the final "grade" for that domain. The biggest problem with the WinInet API is a requirement for a user Windows account, which means that using this API from a Service might pose a problem.
The WinHTTP API also has a built-in connection pool, but it does not limit the number of outgoing connections per domain, and does not require a Windows user to operate, which is better for applications running as Windows Services. But, in case you are running behind a proxy, you will need to manually configure the WInHTTP API in Windows. WinInet and WinHTTP APIs also both have built-in support for SSL, so there is no need for 3rd-party encryption components if you need to work with "HTTPS://" domains.
Then there are Async and Blocking WinSock. Because WinSock does NOT have built-in support for HTTPS, you will need 3rd-party encryption components when working with "HTTPS://" domains. This is not a bad thing in terms of performance, it just requires the use of 3rd-party components, and needs a bit more "setup" work (setting the "useSSL" property to TRUE won't be enough).
Async WinSock has the unique abbility to work with multiple active connections at the same time by using a single thread, without blocking it during the actual communication. But this requires the use of Windows messages, so it will usually be slower in performance than blocking WinSock.
Multi-Threaded mode uses a RTC thread pool, which requires some time for setting up each threads, and requires a bit more CPU than single-threaded mode for thread-switching. This is why opening a connection with MultiThreded=True will usually take more time than with MultiThreded=False, and the overall communication performance on very fast networks could be somewhat slower. But, if you have more CPU and RAM than bandwidth, and you want to run multiple connections parallel, it shouldn't have a big impact on the average performance.
I hope this info helps.
Best Regards,
Danijel Tkalcec