Since the tally of folks that have the same issue seems to be approximately zero, IB having an issue feels unlikely, though not impossible. So let me briefly raise three things that I'd look at if I'd have to trouble shoot API connection issues.
toggle quoted message
Show quoted text
[1] Stale API connections: We once wrote a simple "Is my TWS alive and actually connected to IB" monitor that would connect to TWS, do a simple operation that requires TWS to communicate with IB, and then disconnect. The monitor was started automatically and frequently but somehow caused stale (not completely closed) API connections to build up. When you click "DATA" to get the connections listing in TWS, do you see stale API connections from past script executions? Those did cause connection request delays, in my case, even when TWS was far away from the maximum number of API connections. [2] DNS reverse lookup: You said you checked the network on your server, but did you check DNS as well?
[3] How are your entropy levels? This is a little stretch but fits the symptoms you are having if you are running some kind of Linux system. And it took me weeks to figure that out on a server I had in a data center in Dallas (though this is not specific to Dallas or Texas) In order for strong SSL encryption to work, the Linux kernel collects "truely random events" and builds up a buffer of entropy that Java JVMs (and other programs such as sshd, httpd, ...) access through the /dev/urandom device. And while only very few bytes are needed each time, opening or reading from /dev/urandom when the buffer is low or empty will block the caller until enough entropy has been collected. And the Java JVM frequently opens /dev/urandom when various network related operations take place. You can read up on this with "man urandom" and check your server's entropy level with "cat /proc/sys/kernel/random/entropy_avail" Hope this helps. On Wed, Mar 3, 2021 at 11:51 AM, ExStock wrote:
Thanks--we've checked our network pretty thoroughly, although we'll continue to check anything else we can think of, like making sure there's no excess traffic we've forgotten to take into account.? |