Skip to content

Optimization and Fine Tuning

Alexander Bersenev edited this page Nov 6, 2019 · 1 revision

Here is a few tips how to optimize the proxy:

  1. Install the Python module for cryptography. The proxy supports cryptogrpaphy, pycryptodome and pycrypto modules. If none of them found, the bundled Python cryptography is used, which is very slow

  2. If you have a lot of RAM, try to increase buffers in config.py:

TO_CLT_BUFSIZE = 262144
TO_TG_BUFSIZE = 262144

This will make upload and download faster at price of increased memory usage. The default buffers settings are optimized for 512MB RAM.

  1. Install the uvloop module -- the faster implementation of the main event loop. The performance should improve on ~30%

  2. The proxy is using a single CPU core. If you have multiple cores and the proxy is fully using one of them, the proxy can be launched several times -- the load will be evenly split between the processes

Clone this wiki locally