Hi, I develop smtp relay server using ICS. And I notice very big performance hit if many TSmtpCli's connects to remote MX server in parallel !
I use TDnsQuery to resolve domain's MX server then supply result to TSmtpCli. If I use 100+ TSmtpCli instances most of them waits for OnRequestDone after TSmtpCli.Connect call. Looks like problem in TWSocket.DnsLookup because they call WSocket_Synchronized_WSAAsyncGetHostByName but MSDN say: "The WSAAsyncGetHostByName function is not designed to provide parallel resolution of several names." So, if 100 TSmtpCli's perform Connect they can't do it in parallel because WSAAsyncGetHostByName works sequentially. So 300+ TSmtpCli's works slower than 50 TSmtpCli's because waits for WSAAsyncGetHostByName queue. Can you suggest some workaround to avoid this problem ? At this time I see this way: 1. Use TDNSQuery.MXLookup to resolve MX, then TDNSQuery.ALookup to resolve MX's IP. Then supply resolved MX IP to TSmtpCli to avoid GetHostByName. 2. Cache both MX and A results in my own DNS cache. But maybe you can suggest more efficient way ? Maybe some tuning or secret option in ICS ? Thanks for help ! --- With best regards, Max Terentiev. Business Software Products. AMS Development Team. supp...@bspdev.com -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be