BitBotFactory / MikaLendingBot

Automated lending on Cryptocurrency exchanges Poloniex and Bitfinex
http://poloniexlendingbot.readthedocs.io/en/latest/index.html
MIT License
1.11k stars 344 forks source link

Add DNS cache #617

Closed Evanito closed 6 years ago

Evanito commented 6 years ago

Closes #597 Tested it, and it seems to work pretty well. Only gets the DNS once, then instantly reuses it until it checks again at the start of the next cycle.

Also adds venv created by my IDE to the .gitignore

Description

Closes #597

Reduces DNS requests from several hundred a minute to only a few in the same time.

TESTING STAGE

Types of changes

Checklist:

Evanito commented 6 years ago

screenshot_20180317223811

Vertical axis is DNS requests per 10 minutes. Look at the very right of the chart, where I have enabled this PR. The bot is in orange.

That is one heck of an improvement, I'd say.

Evanito commented 6 years ago

Occasionally getting API Error 521: The web server reported a bad gateway or gateway timeout error. May not be related to PR since there was also an issue accessing Polo in browser.

Maybe have it flush DNS cache on any 5XX error to be safe?

Edit: Also getting the error on master. Edit2: Error resolved self over time, does not look like this PR's fault.

Evanito commented 6 years ago

Bot is working happily with only a minute percentage of the DNS requests