LUCIT-Systems-and-Development / unicorn-binance-websocket-api

A Python SDK by LUCIT to use the Binance Websocket API`s (com+testnet, com-margin+testnet, com-isolated_margin+testnet, com-futures+testnet, com-coin_futures, us, tr, dex/chain+testnet) in a simple, fast, flexible, robust and fully-featured way.
https://unicorn-binance-websocket-api.docs.lucit.tech/
Other
680 stars 165 forks source link

CPU usage #154

Closed thiblab closed 3 years ago

thiblab commented 3 years ago

Hello,

I am using your websocket and I'm highly surprised by the ressources needed. I have an i7 CPU and it is used between 20% and 75% !! Only one channel on 3 crypto are streamed so it does not come from this.

Do you have any idea on how to make it lighter ?

image

Thanks

oliver-zehentleitner commented 3 years ago

Hello!

If you have 8 cores, the lib should be able to use at most 12.5% of your system CPU power (1 core) because of Python GIL.

You also show in the screenshot the system load, not the load of your Python script.

Can you show your code?

Best regards, Oliver

oliver-zehentleitner commented 3 years ago

If you have further questions, just reopen this issue.