Reidmcc / rockfish

Rockfish is an arbitrage bot for the Stellar Decentralized Exchange (SDEX)
MIT License
71 stars 23 forks source link

CPU usage builds over time #20

Closed Reidmcc closed 5 years ago

Reidmcc commented 5 years ago

Describe the bug

Rockfish's CPU usage continuously increases as it runs (though this won't show on system monitor, which is weird).

To Reproduce

Run Rockfish and use gops to check its PID CPU usage. It will build over time.

Expected behavior Rockfish's CPU usage should remain more-or-less stable as it runs.

Notes I think this must be due to goroutines eating up resources as they loop, but the number of goroutines doesn't increase over time. Quick research indicates that using tickers, which Rockfish does, can be expensive.

Version

  version: master:v0.3.0-alpha
  git branch: master
  git hash: 970ce57e11a01a6792b99b697be29e682e30df70
  build date: 20190223T031949Z
  GOOS: linux
  GOARCH: amd64

Additional context This is especially a problem if running on a paid VM like AWS that charges by CPU usage.

Reidmcc commented 5 years ago

closed by https://github.com/Reidmcc/rockfish/pull/21