Page 1 of 5

Computer Configuration for Trading

Posted: Thu May 14, 2020 12:37 am
by dpless01
Hello everyone. During the Live Order Flow Advanced Analysis webinar today (5/13), Bruce and I had a brief discussion about my computer setup for trading. The specs for my machine are shown below. I currently run Bookmap, Thinkorswim, Tradeovate, and Chrome while trading. I am in the process of switching brokers so I can trade directly from Bookmap. When the transfer is complete, I will be running R Trader Pro instead of Tradeovate. My computer runs these programs and drives two 4k monitors without breaking a sweat. My Internet connection is 1 GB fiber. Hope this helps anyone who is considering a new computer for trading.

Chassis Model: Digital Storm Velox
Processor: AMD Ryzen 9 3900X (12-Core) 4.6 GHz Turbo
Motherboard: ASUS PRIME X570-PRO (AMD X570 Chipset) (Up to 3x PCI-E Devices)
System Memory: 64GB DDR4 3200MHz Digital Storm Performance Series
Power Supply: 850W EVGA 850 GQ (Modular) (80 Plus Gold)
Storage Set 1: 1x SSD M.2 (1TB Samsung 970 EVO PLUS) (NVM Express)
Graphics Card(s): 1x GeForce RTX 2070 SUPER 8GB (VR Ready)
Sound Card: Integrated Motherboard Audio
HPC Processor: - No Thanks
Extreme Cooling: H20: Stage 2: Digital Storm Vortex Liquid CPU Cooler (Dual Fan) (Fully Sealed + No Maintenance)
Cable Management: Premium Cable Management (Strategically Routed & Organized for Airflow)
Chassis Fans: Standard Factory Chassis Fans
Operating System: Microsoft Windows 10 Professional (64-Bit Edition)

Re: Computer Configuration for Trading

Posted: Thu May 14, 2020 3:18 pm
by Svyatoslav
Hi. First of all - nice build! It's above what bookmap needs right now, but we are slowly working on multi-threading improvements, so eventually bookmap should be able to fully benefit from that. Also it's good for running many apps in parallel.

However I'd like to provide a bit of input on the subject, mostly for others who might be considering a build and would like to cut the cost down a bit:
- Bookmap is not multithreaded to a point where it can utilize all your cores just yet. Right now there are tasks that are paralleled well, but there are also tasks that are basically single-treaded. So a thing to consider is single thread performance. We are slowly working on it, but at this point - do not expect Bookmap to scale with the number of cores that well (maybe up to 4 cores/8 threads it's pretty noticeable, not so much past that). That being said, since you will be running multiple apps in parallel - you still might benefit from extra cores since bookmap won't be starved of resources.
- SSD is a nice thing to have, NVME one is not a must though. Bookmap isn't usually bottlenecked by IO on SATA SSD's (it can be bottlenecked by HDD's though). Neat trick: only Cache folder really needs to be on SSD. If you want you can move other folders to HDD by creating junctions (https://docs.microsoft.com/en-us/window ... nds/mklink) in Windows. Not sure if symlinks work with Bookmap in Linux/MacOS, in theory those should, bit if not - "bind mount" should work almost for sure.
- GPU isn't that important for Bookmap. By itself BM does not utilize it too much, so even lower end cards will usually do (just don't go too low; something like GTX 1060 should probably be fine), as long as drivers are good. Better GPU won't hurt, but probably won't accelerate Bookmap either. Though I'm not an expert on running multiple large monitors, so maybe in that case GPU matters more.
- about the network - first of all you need low latency and low package loss. You will rarely exceed 100MBit with Bookmap (well, maybe when fetching historical data you might, but not when streaming data), and usually speed at which bookmap gets data will get limited by package loss and latency long before it gets limited by your network bandwidth.

Also, kind of a personal opinion on water cooling - as long as you don't intend to do overclocking and have space in the case for a big air cooler - I recommend to always go for air cooler. Water coolers are nice if you need to move a lot of heat but don't have much space near CPU, but they are usually more expensive and louder. GPU water cooling on the other hand actually does make sense (exactly because of "not much space and a lot of heat" part), but is usually hard to do and doesn't really help Bookmap.

Re: Computer Configuration for Trading

Posted: Fri May 15, 2020 12:43 am
by latnemele
Thank you for the detailed response Svyatoslav! I'm building a PC right now, and I still haven't decided how much memory I should use for it, can you tell me what you think? I'll use a ryzen 5 3600x, nvidia 1070 ti, samsung nvme all in a mesh airflow case, I don't think the rest of the components really matter here.
I'll be subscribed to 6-8 different CME instruments in bookmap, and doing some web browsing on the side. I've settled on 32gb 3200hz, but I'd like to hear your input.

I know that I can set the amount of memory bookmap uses, can you please tell me what the sweet spot of GB per instrument is? Will the larger amount of memory dedicated to bookmap lead to significantly longer JVM pauses?

Re: Computer Configuration for Trading

Posted: Fri May 15, 2020 8:02 am
by Svyatoslav
Hi.
32 GiB should be plenty, in most cases. Bookmap itself, as you correctly mentioned, will follow what you set + a bit of memory for the native code on top of that. However it uses memory mapped files for caches, and OS will actually use your free RAM for those memory mapped files (it will free RAM automatically if it starts getting low - it's just that as long as there is unused memory you'll get small boost because caches won't have to be read from disk) - you actually don't have to worry about it much because the boost is pretty small, but you might see that behavior in task manager.
16GiB is most likely enough for Bookmap + browser (with reasonable number of tabs open) + OS, but if you start running more stuff in parallel you might feel the limitations.

About memory allocation settings - I'd set it to 4GiB (which should be a default if you have 16+ GiB of RAM) and not change it unless you start seeing issues. Without external modules (and with external modules that are not too memory hungry) you should be fine with 4GiB for JVM. About GC pauses - we currently use "G1 GC" which is supposed to minimize pauses reasonably well, so it probably isn't going to be a big deal. We didn't do any extensive testing with heap size beyond 4GiB, since typically it isn't something you'll need, but we have a few clients reporting that it works fine with 8GiB max heap size (that being said - java won't always used allowed maximum, so it's possible that it doesn't really get to 8GiB heap in those cases).

Re: Computer Configuration for Trading

Posted: Sat Aug 29, 2020 8:25 pm
by TomB
Hi: I have been having issues with BM freezing and also artifacts and improper rendering.. pieces of software in wrong place on monitors. I also have the latency issues others have reported from a few milliseconds up to 10-15 seconds. I am considering upgrading my trading computer but I want to make sure I am addressing the correct issues and that whatever I get will solve these problems. 

I would appreciate your recommendation:

BM 7.1.0 Build 50
SI 3.0
LT 3.0
2 Symbols 2 windows open
Memory Allocation Set To 3840Mib of JVM heap

R-Trader Pro - API

Investor R/T

CPU typically runs around 49%
Temperature 50-60 C
Ram around 35%

Currently:

Win 10 - 64Bit
I-7 2600K @3.40Ghz 4 Cores/8 Threads
32G Ram DDR3
AS Rock Z68 Extreme4 MB
223 GB SSD
1 TB HDD
Air Cooled

4- Monitors (If I just run the HD 6700 with only 3 Monitors I have the same issues - the Intel 3000 does not impact it.)
AMD Radeon HD 6700 GPU 1 GB RAM 3 Monitors
Intel 3000 Integrated GPU 1 - Monitor

.Net Ver 4.0
OpenGL 4.1
DirectX 11.0

Based on my research my HD 6700 GPU should handle this. I'd appreciate any input you can give me. All drivers have latest version. I am connected by ethernet my latency is 9ms.

Tx Tom B.
 

Re: Computer Configuration for Trading

Posted: Mon Aug 31, 2020 10:04 am
by Svyatoslav
Hi Tom,
Let's start with an easy part - your GPU most likely is fine, except probably something with the driver. Having parts of the image in wrong places is usually indicative of that. You can try working around it using "Settings"->"Disable Direct3d use for UI" checkbox. By default bookmap forces Java to use OpenGL stack, but sometimes it's broken and switching to Direct3d works better (sometimes using Direct3d results in even worse performance - it depends on computer and drivers, so it can be both ways and is worth trying in either case).

Now, about the latency, being the red text. I can't promise you that upgrade will make it go away. While I have seen in your logs that sometimes CPU is nearly pinned, like in this case:
20200827 14:56:13.894(UTC) INFO: CPU utilization: 0.97,0.98,1.00,0.95,0.97,0.98,0.97,0.98
in other cases there appears to be latency without 100% CPU usage. You will definitely benefit from upgrade in cases where CPU is pinned, but in cases where it's not - it will depend.
If you can - try playing with other Rithmic gateways and try connecting bookmap directly without R Trader in between. Let me know if either of those helps (in support ticket or here). You can also consider unloading addons to see if any of those contribute to the issue - I don't see addons blocking event flow (bookmap attempts to detect that, though not in all cases - e.g "generators" extension is not monitored), but those might be computing something in parallel.

That being said, upgrade to something like 3700X (not sure it's the best option though, if we are talking about choosing a particular CPU - you might be even better going for some Intel CPU with high single-core performance, as R Trader and some parts of Bookmap depend on that) will double your multithreaded performance, making it so one program will be very unlikely to starve another one of CPU resources. However before you go for an upgrade, I'd suggest to try capturing the moment you see lag with the task manager - we'd at least confirm it's not something like a background antivirus scan that suddenly takes the resources. I see a screenshot in the ticket, but it appears to me that while it was at close you didn't have lag at that point. Am I wrong?

So, the bottom line - upgrading will give you more power and will either alleviate or solve everything except network issues (e.g. package loss), especially if you go for a CPU with high single-threaded performance and reasonable number of cores (8+ cores; not to confuse with threads). But I'd recommend capturing the moment when 5+ seconds lag happens with task manager to locate the source more precisely.

Re: Computer Configuration for Trading

Posted: Mon Aug 31, 2020 1:27 pm
by TomB
Tx for the prompt response. I will watch it and reply when I have a clearer picture if I can identify where it is happening. I have set up a CPU and GPU temperature monitoring to see what is happening and also watching in Task Mgr. I have also put a fan temperature controller to keep thinks cooler in case heat is an issue. Again Tx. 

Re: Computer Configuration for Trading

Posted: Mon Aug 31, 2020 2:38 pm
by TomB
I am watching things and the greatest strain on CPU is when I zoom, which will freeze the screen and also when I run the correlation tracker with it.. I have one symbol on correlation tracker. This does not account for any fast market condition.

The CPU hit 90% while stressing the zoom with the correlation tracker. 

Without the correlation tracker, stressing the zoom it hit about 75%

Just operating normally with the correlation tracker it runs around 20 -  50%

In Task Mgr when I zoom with correlation tracker BM consumes apx 77% of CPU. 

It seems the zoom and the correlation tracker combo really hits it.

MY CPU temp is 50 deg C and GPU stable at 61 deg C. 

Memory apx 28%

I will add to this when I have fast market to compare. Tx Tom

Re: Computer Configuration for Trading

Posted: Mon Aug 31, 2020 2:46 pm
by Svyatoslav
Hi. Note that zoom taking resources is normal, as long as zoom by itself does not take long.
1. How long does it take to finish handling the action?
2. Which instrument are you testing zoom on?

Note that correlation tracker is known to be pretty heavy. Last trade mode is lighter than mid price, so you can save some performance there.

Also,
3. What is the recentering mode that you have set? (you specify it by right clicking on the price axis)
4. Does changing settings->chart refresh rate from default 25 to, say, 100 make a difference? 30-50% under no load is actually pretty bad. I'd expect it to be closer to 10 when you aren't actively interacting with the window.
5. Does unloading all plugins change CPU usage when not interacting with bookmap?

Re: Computer Configuration for Trading

Posted: Mon Aug 31, 2020 4:43 pm
by TomB
It is taking about 5-6 seconds. CPU jumps to 80 % ish with correlation tracker. It is the same on ES or NQ.

It is the same if recenter is set to BBO or none.

I changed the chart refresh rate to 100. I did not notice any difference.

If I unload just about everything except Heatmap and Vol Dots my CPU is at 15%. BM is 4-6%

When I scroll I have gotten data latency of 1.5 seconds  With everything unloaded BM on Task Mgr goes to 65% otherwise it is running around 4-6%

I am waiting for the close to  Disable Direct3D but I think I have tried this previously.

I have the latest drivers for my GPU but they are from 2015.

In addition my Memory usage is gradually climbing. It is currently at 36%  after 4.5 hours market time. it was around 24-25% this morning

Tx

Tom