Comments (21)
I have this problem too
from mtprotoproxy.
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,
Alexander Bersenev
from mtprotoproxy.
Thank you for explanation!
I am wondered, that version 1.0.0 slower than version 0.9.5, like 510Kb/s vs 2,5Mb/s (~5 times difference), even with the same buffer size. I can't find any reason for this.
P.S. Buffer size for version 1.0.0 changed via config.py.
from mtprotoproxy.
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).
from mtprotoproxy.
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:
TO_CLT_BUFSIZE = 16384
CLIENT_KEEPALIVE = 30*60
Speed of master branch ~600Kb/s
Speed of version 0.9.5 ~ 3Mb/s
from mtprotoproxy.
Could you, please try to remove this string from the do_direct_handshake function:
set_bufsizes(writer_tgt.get_extra_info("socket"), TO_CLT_BUFSIZE, TO_TG_BUFSIZE)
and rerun the test
from mtprotoproxy.
Thank you!
After this change, speed of master branch version increased to 2,6Mb/s - 3,06Mb/s
from mtprotoproxy.
i increased buffer to 64000
and removed this string:
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
from mtprotoproxy.
could you, please, retry with these two string in config.py:
TO_CLT_BUFSIZE = 655360
TO_TG_BUFSIZE = 655360
from mtprotoproxy.
Still very slow
250 KB/S
from mtprotoproxy.
also to make sure that this is due buffers, could you comment out all set_bufsizes calls (there should be two of them)
from mtprotoproxy.
commented two of them and tested
still slow speed
from mtprotoproxy.
then, it is likely no due buffering changes. What is the CPU load during downloading?
from mtprotoproxy.
cpu is normal during download and upload , cpu 3~7 percent
from mtprotoproxy.
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?
from mtprotoproxy.
yes im sure (0.9.5)
my server port is ok , download speed is above 20MB/S
and my download speed from telegram.org is 18MB/S
from mtprotoproxy.
And in version 1.0.0 i get this error:
error updating middle proxy list
error updating middle proxy list for ipv6
error updating middle proxy list secret , using old
version 0.9.5 i dont get any error
from mtprotoproxy.
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?
from mtprotoproxy.
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
from mtprotoproxy.
from mtprotoproxy.
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
from mtprotoproxy.
Related Issues (20)
- proxy
- unknown rpc ans type: b'\xdf\xa20W' HOT 1
- MTProxy Admin Bot dont accept my secret cause python script make it more than 32 hex. Please, help!
- . HOT 2
- .
- . HOT 1
- When open telegam app , it takes too long time wait for connecting to the proxy HOT 2
- Proxy works on Telegram Desktop (Windows) but not on Android Telegram
- Error in source code
- Does MTProto allow to route all a device internet traffic to the proxy? Like a VPN? HOT 1
- .
- IPV6 dont work when i add users
- IP white list method - amazon changer & checker - local server tunnel
- Installing Python MTProxy on CentOS 8 with Python update HOT 5
- port change doesnt work in config.py HOT 1
- Dokerfile for debian 12 HOT 1
- ERROR: Service 'mtprotoproxy' failed to build: The command '/bin/sh -c apt-get update && apt-get install --no-install-recommends -y python3 python3-uvloop python3-cryptography python3-socks libcap2-bin ca-certificates && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100 HOT 3
- It only works for a few minutes HOT 2
- python3.12 run Error HOT 3
- Proxy
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mtprotoproxy.