🤸‍♂️Tips & Tricks

Ensure the best performance from your bot

Windows connection port increase

Open Windows Powershell in Administrator mode and input the following commands:

$KeyPath = "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
Set-ItemProperty -Path $KeyPath -Name "MaxUserPort" -Value 65534

netsh int ipv4 set dynamicport tcp start=10000 num=50000 #not required, do this if you have TCP error

A computer reboot is required after executing this command!

This will increase your maximum open connections at once to 65534, which will cause an increase in your TPS.

Linux file descriptor limit increase & buffer size increase

(Commands were tested on Ubuntu 20.04)

Input the following commands into your Linux shell:

# ulimits 
echo "fs.file-max = 999999" >> /etc/sysctl.conf
sysctl -w net.core.rmem_max=2500000
sysctl -p

echo "* hard nofile 999999" >> /etc/security/limits.conf
echo "* soft nofile 999999" >> /etc/security/limits.conf
echo "root hard nofile 999999" >> /etc/security/limits.conf
echo "root soft nofile 999999" >> /etc/security/limits.conf

A computer reboot is required after executing this command!

This will increase your maximum possible TPS and prevent the "too many open sockets" error from happening.

Last updated