Closed mizzdev closed 4 years ago
Well, it seems that my DigitalOcean metric collection system has been lying since scaling the VPS from 1 vCPU to 3vCPU plan:
As you can see, it fact all 3 CPUs are around 20% loaded. False alarm :)
Anyway, question 3 is what I'm still curious about hence I won't hurry to close this issue.
Hey! Thanks for your interest in the project!
Awhile back this project actually did use worker threads and configured them to be scaled with the number of CPU cores available. The problem that I ran into was the overhead in passing information to/from worker threads wasn't worth the gain in speed.
For further discussion the worker threads were assigned to do calculations for each "cycle" ie: every 250ms a cycle is initiated where the app iterates through all possible arbitrage positions and calculates expected profit on each. This calculation was farmed out to worker threads and performed asynchronously in a pool.
I never experimented with a cluster. In theory you could split the workload between between 2 apps right now with no need for clustering where each app runs on it's own core. You would need to divide the total number of possible arbitrage pairings in half and assign whitelists/blacklists to force each app to only scan a subset of the market.
Thanks for detailed response!
I never experimented with a cluster. In theory you could split the workload between between 2 apps right now with no need for clustering where each app runs on it's own core. You would need to divide the total number of possible arbitrage pairings in half and assign whitelists/blacklists to force each app to only scan a subset of the market.
I think I'll give it a try once I get some actual trades executed and collect some statistics. One of the viable approaches may be to dockerize the app and manipulate config.json through container start parameters or image build parameters in some way, thus there will be no need to alter the actual source code to support configuration switching. Anyway, that's a little bit outside of the current discussion.
Cheers!
Hi there!
Currently I'm running the arbitrage bot on a VPS with 3 CPUs, which are recognized according to the performance log:
However, it seems that only one of the CPUs out of three is efficiently loaded having the rest of them idle:
Here is what top output shows:
I am aware that Node.js operates in a single thread when it comes to execution of user code while managing the thread pools for variouts I/O (e.g. HTTP requests, Websocket handling, FS, database connection, etc.).
The questions are:
Huge thanks in advance!