-
Notifications
You must be signed in to change notification settings - Fork 352
Optimization and Fine Tuning
Here is a few tips how to optimize the proxy:
-
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
-
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.
-
Install the uvloop module -- the faster implementation of the main event loop. The performance should improve on ~30%
-
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