chrisleekr / binance-trading-bot

Automated Binance trading bot - Trade multiple cryptocurrencies. Buy low/sell high with Grid Trading. Integrated with TradingView technical analysis
MIT License
5.09k stars 1.1k forks source link

Write ENOBUFS #617

Closed dasbts closed 1 year ago

dasbts commented 1 year ago

Randomly got this new error after pulling to the newest git pull and docker compose (yes I use the compose without "-" on Ubuntu) and running it for some hours. Have no open GUIs. Was hoping this would fix the redis issue with the redlock but it might have some connection to trying to lock the latest candle as seen in the image from Slack. However, I received a bunch of the latest-candle lock issues earlier today, no ENOBUFS was ever seen before (and no issue on it previously created either).

image

According to this link, there seem to be some parameter "agent:false" that can be added to requests. https://stackoverflow.com/questions/10603860/very-simple-node-js-client-throws-error-enobufs-after-many-http-requests

dasbts commented 1 year ago

This was 99% likely memory issue. Fixed by tuning the server and adding ZRam then optimizing the /etc/sysctl.conf file as follows: vm.vfs_cache_pressure=550 vm.swappiness=100 vm.dirty_background_ratio=4 vm.dirty_ratio=30 vm.overcommit_memory=1 vm.watermark_scale_factor=15 vm.page-cluster=0 vm.min_free_kbytes=225000 vm.page_lock_unfairness=4

Different settings for different computers. Mine is 6GB Acer Aspire and this worked well for that one with high I/O usage. I now have ~30% free at all time.