IB Gateway Stability

Per my previous case I worked with IBKR support and resolved the ib gateway access issues but I'm still having a lot of problems collecting historic data. A few issues:

(1) Stability of connections. After I connect to the ib gateways they appear to be very unstable, in particular ibg1 (which I have connected to my paper trading account).
(2) Speed of data collection. I understand downloading data from IBKR can be slow and I read the time estimates you provided in the Usage Guide so I knew what to expect. What's challenging is knowing if what I'm experiencing is normal or if the issues are related to the connections being severed and unstable.

I gave up on trying to use two gateways because ibg1 was disconnecting so frequently and focused on ibg2 (live trading account) because it seems to be more stable. The IB GUI for ibg2 will show all green for awhile but then the "Historical Data Farm" turns yellow after awhile and after that happens it doesn't go back to green. It also seems to coincide with the data collection stopping.

I've placed below snippets of representative Logs below. Any guidance would be appreciated.

Thanks.

2024-07-26 18:02:48 quantrocket.blotter: WARNING ibg2 client 6001 got IBKR message code 1100: Connectivity between IB and Trader Workstation has been lost.
2024-07-26 18:03:05 quantrocket.history: WARNING ibg2 client 6397 got IBKR message code 1100: Connectivity between IB and Trader Workstation has been lost.
2024-07-26 18:03:05 quantrocket.blotter: WARNING ibg2 client 6001 got IBKR message code 1100: Connectivity between IB and Trader Workstation has been lost.
2024-07-26 18:03:44 quantrocket.ibg2: INFO starting ibg2
2024-07-26 18:04:56 quantrocket.ibg2: WARNING Second factor authentication required to complete login, please check your mobile device for a notification. See http://qrok.it/h/ib2fa for help.
2024-07-26 18:05:56 quantrocket.history: WARNING [ibkr-futures-15mins] Waiting to collect ibkr-futures-15mins history because no ibg services are running, please start service(s)
2024-07-26 18:06:47 quantrocket.ibg2: WARNING ibg2 still not started, will stop and start again
2024-07-26 18:06:47 quantrocket.ibg2: INFO stopping ibg2
2024-07-26 18:06:57 quantrocket.ibg2: WARNING ibg2 didn't stop when asked nicely, so forcing it to stop
uantrocket-flightlog-1|2024-07-26 18:06:57 quantrocket.ibg2: WARNING ibg2 didn't stop when asked nicely, so forcing it to stop
     quantrocket-ibg2-1|/usr/bin/subcmd/start: line 27: 56986 Killed                  /root/Jts/ibgateway/${TWS_MAJOR_VRSN}/ibgateway > "${log_file}" 2>&1
quantrocket-flightlog-1|2024-07-26 18:07:09 quantrocket.ibg2: INFO starting ibg2
     quantrocket-ibg2-1|Starting socat.
     quantrocket-ibg2-1|Starting virtual X frame buffer: Xvfb.
     quantrocket-ibg2-1|subprocess 58427 exited with code 1
     quantrocket-ibg2-1|subprocess 58437 exited with code 1
     quantrocket-ibg2-1|Starting x11vnc.
     quantrocket-ibg2-1|Starting websockify.
     quantrocket-ibg2-1|Starting IB Gateway 1019
     quantrocket-ibg2-1|subprocess 58459 exited with code 1
     quantrocket-ibg2-1|subprocess 58469 exited with code 1
  quantrocket-history-1|┌────────────────────────────────────────┐
  quantrocket-history-1|│ ibkr-futures-15mins processing stages: │
  quantrocket-history-1|│ head timestamps          230           │
  quantrocket-history-1|│ historical data          142           │
  quantrocket-history-1|│ waiting for responses      0           │
  quantrocket-history-1|│ bar processing             0           │
  quantrocket-history-1|│ database storage           0           │
  quantrocket-history-1|│ completed                348           │
  quantrocket-history-1|└────────────────────────────────────────┘
  quantrocket-history-1|┌───────────────────────────────────────────────┐
  quantrocket-history-1|│ ibkr-futures-15mins completion report:        │
  quantrocket-history-1|│ successful completions                      4 │
  quantrocket-history-1|│ data unavailable                          342 │
  quantrocket-history-1|│ partial completions before no response     59 │
  quantrocket-history-1|│ no permission                               0 │
  quantrocket-history-1|│ security not found (error 200)              1 │
  quantrocket-history-1|│ head timestamp errors/timeouts              0 │
  quantrocket-history-1|└───────────────────────────────────────────────┘
  quantrocket-history-1|┌──────────────────────────────────────────┐
  quantrocket-history-1|│ ibkr-futures-15mins IBKR response times: │
  quantrocket-history-1|│        ibg2                              │
  quantrocket-history-1|│ count  40.0                              │
  quantrocket-history-1|│ mean    3.7                              │
  quantrocket-history-1|│ std     2.6                              │
  quantrocket-history-1|│ min     1.7                              │
  quantrocket-history-1|│ 25%     2.9                              │
  quantrocket-history-1|│ 50%     3.1                              │
  quantrocket-history-1|│ 75%     3.3                              │
  quantrocket-history-1|│ max    17.0                              │
  quantrocket-history-1|└──────────────────────────────────────────┘
  quantrocket-history-1|┌────────────────────────────────────────┐
  quantrocket-history-1|│ ibkr-futures-15mins processing stages: │
  quantrocket-history-1|│ head timestamps          230           │
  quantrocket-history-1|│ historical data          142           │
  quantrocket-history-1|│ waiting for responses      0           │
  quantrocket-history-1|│ bar processing             0           │
  quantrocket-history-1|│ database storage           0           │
  quantrocket-history-1|│ completed                348           │
  quantrocket-history-1|└────────────────────────────────────────┘
  quantrocket-history-1|┌───────────────────────────────────────────────┐
  quantrocket-history-1|│ ibkr-futures-15mins completion report:        │
  quantrocket-history-1|│ successful completions                      4 │
  quantrocket-history-1|│ data unavailable                          342 │
  quantrocket-history-1|│ partial completions before no response     59 │
  quantrocket-history-1|│ no permission                               0 │
  quantrocket-history-1|│ security not found (error 200)              1 │
  quantrocket-history-1|│ head timestamp errors/timeouts              0 │
  quantrocket-history-1|└───────────────────────────────────────────────┘
  quantrocket-history-1|┌────────────────────────────────────────┐
  quantrocket-history-1|│ ibkr-futures-15mins processing stages: │
  quantrocket-history-1|│ head timestamps          230           │
  quantrocket-history-1|│ historical data          142           │
  quantrocket-history-1|│ waiting for responses      0           │
  quantrocket-history-1|│ bar processing             0           │
  quantrocket-history-1|│ database storage           0           │
  quantrocket-history-1|│ completed                348           │
  quantrocket-history-1|└────────────────────────────────────────┘
  quantrocket-history-1|┌───────────────────────────────────────────────┐
  quantrocket-history-1|│ ibkr-futures-15mins completion report:        │
  quantrocket-history-1|│ successful completions                      4 │
  quantrocket-history-1|│ data unavailable                          342 │
  quantrocket-history-1|│ partial completions before no response     59 │
  quantrocket-history-1|│ no permission                               0 │
  quantrocket-history-1|│ security not found (error 200)              1 │
  quantrocket-history-1|│ head timestamp errors/timeouts              0 │
  quantrocket-history-1|└───────────────────────────────────────────────┘
     quantrocket-ibg2-1|IB Gateway should be running but is not accepting connections. Please open the IB Gateway GUI to troubleshoot, see http://qrok.it/h/ibgui for help. IBC log output is below:
     quantrocket-ibg2-1|java.home = /opt/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|sun.arch.data.model = 64
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|user.language = en
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|java.specification.vendor = Oracle Corporation
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|awt.toolkit = sun.awt.X11.XToolkit
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|java.vm.info = mixed mode
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|privateLabel = ib
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|java.version = 1.8.0_202
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|installer.groupId = 
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|java.ext.dirs = /opt/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/ext:/usr/java/packages/lib/ext
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|sun.boot.class.path = /opt/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/resources.jar:/opt/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/rt.jar:/opt/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/sunrsasign.jar:/opt/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/jsse.jar:/opt/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/jce.jar:/opt/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/charsets.jar:/opt/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/lib/jfr.jar:/opt/i4j_jres/Oda-jK0QgTEmVssfllLP/1.8.0_202/classes
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|java.vendor = Oracle Corporation
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|file.separator = /
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|twslaunch.autoupdate.serviceImpl = com.ib.tws.twslaunch.install4j.Install4jAutoUpdateService
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|java.vendor.url.bug = http://bugreport.sun.com/bugreport/
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|install4jType = ${installer:installerType}
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|sun.io.unicode.encoding = UnicodeLittle
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|sun.cpu.endian = little
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|sun.locale.formatasdefault = true
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|installerVersion = 4.6.12
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|sun.cpu.isalist = 
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|------------------------------------------------------------
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:17:322 IBC: Using default main window manager: null
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:17:325 IBC: Using default config dialog manager
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:17:348 IBC: CommandServer is starting with port 7460
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:17:744 IBC: CommandServer listening on addresses: 172.18.0.12,127.0.0.1; port: 7460
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:17:745 IBC: CommandServer started and is ready to accept commands
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:311 IBC: TWS Settings directory is: /root/Jts/ibgateway/1019
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:330 IBC: Ensuring /root/Jts/ibgateway/1019/jts.ini contains required minimal lines
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:331 IBC: Found setting: [Logon]/s3store=true
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:332 IBC: Found setting: [Logon]/Locale=en
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:332 IBC: Found setting: [Logon]/displayedproxymsg=1
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:332 IBC: Found setting: [IBGateway]/ApiOnly=true
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:333 IBC: Confirmed /root/Jts/ibgateway/1019/jts.ini contains required minimal lines
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:355 IBC: Getting config dialog
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:355 IBC: Getting config dialog
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:356 IBC: Creating config dialog future
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:359 IBC: Getting config dialog
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:366 IBC: Getting config dialog
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:370 IBC: Getting main window
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:370 IBC: Creating main window future
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:373 IBC: Getting config dialog
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:374 IBC: Waiting for config dialog future to complete
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:377 IBC: Waiting for config dialog future to complete
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:380 IBC: Waiting for config dialog future to complete
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:381 IBC: Waiting for config dialog future to complete
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:388 IBC: Getting config dialog
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:389 IBC: Waiting for config dialog future to complete
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:393 IBC: Getting config dialog
     quantrocket-ibg2-1|
     quantrocket-ibg2-1|2024-07-26 18:07:18:397 IBC: Waiting for config dialog future to complete
     quantrocket-ibg2-1|
quantrocket-flightlog-1|2024-07-26 18:10:09 quantrocket.ibg2: WARNING ibg2 still not started, will stop and start again
quantrocket-flightlog-1|2024-07-26 18:10:09 quantrocket.ibg2: INFO stopping ibg2
quantrocket-flightlog-1|2024-07-26 18:10:19 quantrocket.ibg2: WARNING ibg2 didn't stop when asked nicely, so forcing it to stop
     quantrocket-ibg2-1|/usr/bin/subcmd/start: line 27: 58471 Killed                  /root/Jts/ibgateway/${TWS_MAJOR_VRSN}/ibgateway > "${log_file}" 2>&1
quantrocket-flightlog-1|2024-07-26 18:10:29 quantrocket.ibg2: INFO starting ibg2
     quantrocket-ibg2-1|Starting socat.
     quantrocket-ibg2-1|Starting virtual X frame buffer: Xvfb.
     quantrocket-ibg2-1|subprocess 59788 exited with code 1
     quantrocket-ibg2-1|subprocess 59798 exited with code 1
     quantrocket-ibg2-1|Starting x11vnc.
     quantrocket-ibg2-1|Starting websockify.
     quantrocket-ibg2-1|Starting IB Gateway 1019
     quantrocket-ibg2-1|subprocess 59820 exited with code 1
     quantrocket-ibg2-1|subprocess 59830 exited with code 1
  quantrocket-history-1|┌────────────────────────────────────────┐
  quantrocket-history-1|│ ibkr-futures-15mins processing stages: │
  quantrocket-history-1|│ head timestamps          230           │
  quantrocket-history-1|│ historical data          142           │
  quantrocket-history-1|│ waiting for responses      0           │
  quantrocket-history-1|│ bar processing             0           │
  quantrocket-history-1|│ database storage           0           │
  quantrocket-history-1|│ completed                348           │
  quantrocket-history-1|└────────────────────────────────────────┘
  quantrocket-history-1|┌───────────────────────────────────────────────┐
  quantrocket-history-1|│ ibkr-futures-15mins completion report:        │
  quantrocket-history-1|│ successful completions                      4 │
  quantrocket-history-1|│ data unavailable                          342 │
  quantrocket-history-1|│ partial completions before no response     59 │
  quantrocket-history-1|│ no permission                               0 │
  quantrocket-history-1|│ security not found (error 200)              1 │
  quantrocket-history-1|│ head timestamp errors/timeouts              0 │
  quantrocket-history-1|└───────────────────────────────────────────────┘
quantrocket-flightlog-1|2024-07-26 18:10:57 quantrocket.history: WARNING [ibkr-futures-15mins] Waiting to collect ibkr-futures-15mins history because no ibg services are running, please start service(s)

@Brian I should mention that I'm running a MAC M1 processor. I'm trying to understand what kind of stability of connection I should expect and if what I'm experiencing is normal. Thanks.

Running IB Gateway on Apple Silicon may or may not work but is not officially supported. Please see the note in the Mac installation guide: Installation Tutorial for Mac

@Brian fair enough. For some reason I thought the M1 silicon issue had been addressed with the most recent QR version release but maybe that was my imagination.

If I were to go with the Digital Ocean Droplet configuration below (per Sizing Guidance provided by Quantrocket) is there anything else I'm missing?

(Pricing Calculator | DigitalOcean)

  • Memory Optimized package (16 GiB)
  • 1x SSD
  • 2 CPUs
  • 50 GiB SSD Disc
  • 4,000 GiB transfer
  • 50 GiB of additional Block Storage

Thanks.