Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: improve performance mongodb and redis #288

Merged
merged 5 commits into from
Aug 31, 2021

Conversation

chrisleekr
Copy link
Owner

Description

  • Added indexes for MongoDB
  • Updated configuration to use cache as well to improve performance
  • Updated redis.conf to disable AOF for improving performance
  • Moved grid/manual orders to MongoDB from Redis since Redis is not persistent anymore
  • Updated MongoDB to not acknowledge insert/update/delete

Related Issue

#262

Motivation and Context

Since the bot was showing performance issues in Raspberry Pi, I started to look at how to improve the performance.

By disabling AOF in Redis and write concern in MongoDB(risky but worth), it starts showing lower CPU usage.

How Has This Been Tested?

Screenshots (if appropriate):

image

@codecov-commenter
Copy link

codecov-commenter commented Aug 29, 2021

Codecov Report

Merging #288 (9d99675) into master (7428545) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #288   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           75        75           
  Lines         2591      2539   -52     
  Branches       439       434    -5     
=========================================
- Hits          2591      2539   -52     
Impacted Files Coverage Δ
...b/trailingTrade/step/place-sell-stop-loss-order.js 100.00% <ø> (ø)
app/cronjob/trailingTrade/steps.js 100.00% <ø> (ø)
app/cronjob/trailingTrade.js 100.00% <100.00%> (ø)
app/cronjob/trailingTrade/step/cancel-order.js 100.00% <100.00%> (ø)
app/cronjob/trailingTrade/step/determine-action.js 100.00% <100.00%> (ø)
...lingTrade/step/ensure-grid-trade-order-executed.js 100.00% <100.00%> (ø)
.../cronjob/trailingTrade/step/ensure-manual-order.js 100.00% <100.00%> (ø)
app/cronjob/trailingTrade/step/get-open-orders.js 100.00% <100.00%> (ø)
app/cronjob/trailingTrade/step/place-buy-order.js 100.00% <100.00%> (ø)
...p/cronjob/trailingTrade/step/place-manual-trade.js 100.00% <100.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b072d8...9d99675. Read the comment docs.

@chrisleekr chrisleekr changed the title Perf/improve performance mongodb redis perf/improve performance mongodb redis Aug 29, 2021
@chrisleekr chrisleekr changed the title perf/improve performance mongodb redis perf: improve performance mongodb redis Aug 29, 2021
@chrisleekr chrisleekr changed the title perf: improve performance mongodb redis perf: improve performance mongodb and redis Aug 29, 2021
Copy link
Contributor

@habibalkhabbaz habibalkhabbaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chrisleekr for this nice improvements 🏆
I tested this pull request and I only found one issue.

@chrisleekr chrisleekr merged commit b1c4edc into master Aug 31, 2021
@chrisleekr chrisleekr deleted the perf/improve-performance-mongodb-redis branch September 3, 2021 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants