Giter Club home page Giter Club logo

Comments (21)

GoldenOne1 avatar GoldenOne1 commented on August 27, 2024

I have this problem too

from mtprotoproxy.

alexbers avatar alexbers commented on August 27, 2024

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.

devbreath avatar devbreath commented on August 27, 2024

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.

alexbers avatar alexbers commented on August 27, 2024

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.

devbreath avatar devbreath commented on August 27, 2024

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.

alexbers avatar alexbers commented on August 27, 2024

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.

devbreath avatar devbreath commented on August 27, 2024

Thank you!

After this change, speed of master branch version increased to 2,6Mb/s - 3,06Mb/s

from mtprotoproxy.

GoldenOne1 avatar GoldenOne1 commented on August 27, 2024

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.

alexbers avatar alexbers commented on August 27, 2024

could you, please, retry with these two string in config.py:
TO_CLT_BUFSIZE = 655360
TO_TG_BUFSIZE = 655360

from mtprotoproxy.

GoldenOne1 avatar GoldenOne1 commented on August 27, 2024

Still very slow

250 KB/S

from mtprotoproxy.

alexbers avatar alexbers commented on August 27, 2024

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.

GoldenOne1 avatar GoldenOne1 commented on August 27, 2024

commented two of them and tested

still slow speed

from mtprotoproxy.

alexbers avatar alexbers commented on August 27, 2024

then, it is likely no due buffering changes. What is the CPU load during downloading?

from mtprotoproxy.

GoldenOne1 avatar GoldenOne1 commented on August 27, 2024

cpu is normal during download and upload , cpu 3~7 percent

from mtprotoproxy.

alexbers avatar alexbers commented on August 27, 2024

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.

GoldenOne1 avatar GoldenOne1 commented on August 27, 2024

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.

GoldenOne1 avatar GoldenOne1 commented on August 27, 2024

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.

alexbers avatar alexbers commented on August 27, 2024

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.

GoldenOne1 avatar GoldenOne1 commented on August 27, 2024

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.

GoldenOne1 avatar GoldenOne1 commented on August 27, 2024

@alexbers

from mtprotoproxy.

alexbers avatar alexbers commented on August 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.