coinapi-sdk icon indicating copy to clipboard operation
coinapi-sdk copied to clipboard

Go client high CPU load

Open arniwesth opened this issue 3 years ago • 1 comments

Environment:
OS: Linux Mint 20.1
Kernel: 5.4.0-80-generic
CPU: Intel© Core™ i7-2600K CPU @ 3.40GHz × 4
Mem: 24 GB 

I'm testing the Go websocket client, but are having some issues. When subscribed to all trades (production feed):

  • Just receiving (no further processing) causes a CPU usage of 110-120%
  • After a while, the connection will close with either an Unexpected EOF or being closed because too many messages are buffered by the sender.

When running the C# websocket client (targeting net5.0) on the same environment and subscribing to all trades, the CPU usage is ~20-40% and it seems to be more stable.

When running the Python websocket client on the same environment, the CPU usage is ~35-50%

I would have assumed the Go client to be at least as efficient as the C# client and more efficient than Python. Any thoughts on this?

arniwesth avatar Aug 05 '21 20:08 arniwesth

Yes, that's correct. I'm working currently on an improved go WS client as there a multiple issues with the current implementation which wasn't stress tested.

marvin-hansen avatar Sep 01 '21 14:09 marvin-hansen