-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 1.0.0 has less perfromance, than 0.9.5 #41
Comments
I have this problem too |
Hi, There is a trade-off between memory consumption and performance. The more buffers you have, the more speed you are able to reach, but the more memory you need. The proxy can be launched on different hardware: on the machine with several hundreds GB of RAM, or on the small home router with hundreds MB of RAM. And the purpose of proxy can also be different: it can be for small company, or for large ones. I am trying to specify the defaults to fit the requirements of most users. In the lattest version I increased its size back to 16384: c2ad0de. But if you need more speed, or have a lot of memory you can enlarge it even more until the speed will be satisfying. Best, |
Thank you for explanation! P.S. Buffer size for version 1.0.0 changed via config.py. |
I think is because I forgot to set buffer sizes in some case: 675d5a6#diff-e2b821dc5d96409f0102669d33aa8637R609. This caused the default OS limit was used, and it is a fairly big limit (about 400KBytes on my test OS). |
Just for information, a few seconds ago, I made new docker image from your master branch. Upload my config.py from version 0.9.5 and add follow strings: |
Could you, please try to remove this string from the do_direct_handshake function: and rerun the test |
Thank you! After this change, speed of master branch version increased to 2,6Mb/s - 3,06Mb/s |
i increased buffer to 64000 set_bufsizes(writer_tgt.get_extra_info("socket"), TO_CLT_BUFSIZE, TO_TG_BUFSIZE) but still download speed is very low Version 0.9.5 was very fast |
could you, please, retry with these two string in config.py: |
Still very slow 250 KB/S |
also to make sure that this is due buffers, could you comment out all set_bufsizes calls (there should be two of them) |
commented two of them and tested still slow speed |
then, it is likely no due buffering changes. What is the CPU load during downloading? |
cpu is normal during download and upload , cpu 3~7 percent |
the only variant left is the speed became slower due to internet provider of the server. Are you sure that the speed is still ok with v0.9.5? |
yes im sure (0.9.5) my server port is ok , download speed is above 20MB/S |
And in version 1.0.0 i get this error: error updating middle proxy list version 0.9.5 i dont get any error |
the logic of getting middle proxy list wasn't changed between 1.0.0 and 0.9.5. May be the packets from 1.0.0 are blocked by windows firewall? |
Yes exactly I turned off firewall and i don't get error any more Picture download speed become very fast and improved a lot Video download speed is still very very low 250KB/S Do you have any idea for video? And how can i turn firewall on without proxy problem? I already opened my proxy port in firewall and i don't know which port telegram uses |
The video speed could be low because the video is downloaded from some far telegram datacenter. You can try to increase the buffer sizes even more or try to compose custom telegram servers list by modifying https://core.telegram.org/getProxyConfig, leaving only few fastest server from every group and assigning them to TG_MIDDLE_PROXIES_V4 variable and commenting out the TG_MIDDLE_PROXIES_V4 = v4_proxies line. Also you can try to use "proxy_for 4" servers from "proxy_for -4" ones |
Hi,
After switching to version 1.0.0, I found, that clients may transfer data with less 250Kb/s. Version 0.9.5 executed on the same machine in separate docker provide 2,5Mb/s.
I changed size of buffer TO_CLT_BUFSIZE = 16384 via config.py and speed was improved to 510Kb/s (v1.0.0).
Both tests was done on the same physical machine, with different docker containers, the same secrets and the same clients(desktop and Android). If I switch to "secure" secret, I've also get less performance rate(v1.0.0).
Have you got any suggestions, why new version may be slower on the same secrets?
The text was updated successfully, but these errors were encountered: