Repository navigation
Faster file transfers: Client.FileDC downloads through media-only DC addresses (about 10 times faster), and the uploader keeps 8 MiB of parts in flight. Layer 234.
Features
Downloads through media-only DC addresses (#2010)
- Telegram limits
upload.getFilethrough the regular addresses of a DC to about 5 MiB/s per account, Premium included, withFLOOD_WAITon top; through the media-only addresses (dc_optionswithmedia_only) it doesn't. Telegram Desktop, Android and tdlib download files there. Client.FileDCnow connects to the media-only addresses where the config of the client lists them for the DC, and falls back to the regular ones otherwise.Options.FileDCRegularOnlyrestores the old behaviour.- Measured on production, Premium account, 1211 MiB on DC 2, 1 MiB parts: 5.3 MiB/s with 253 flood waits before; 39.8 MiB/s with the default pool of 4 connections and 52.6 MiB/s with 16, without flood waits.
- The list of media-only addresses depends on the account and not every DC has them:
Client.MediaOnlyto a DC without them now fails at once withErrNoMediaOnly.
Uploads send 8 MiB of parts at a time (#2008, #2009)
- Parts of small files are sent in parallel too, big files and streams use 512 KiB parts, and by default as many parts are in flight as fit into 8 MiB (
WithThreadsstill sets it), like Telegram for Android. - On a slow link the connection counts the bytes of unanswered requests and allows them time, like Telegram Desktop: the pong limit grows and resends wait for the backlog (
rpc.Options.Backlog), so a big upload is no longer cut by a missed pong or flooded with resent parts.
Timings of pushed updates (#1986)
gotd.client.updates.server.delay,receive.delay,process.durationandhandle.durationhistograms and anUpdate timingdebug record;mtproto.MessageInfoHandlerfor the msg_id, receive time and server time offset of a message. Seedocs/update-latency.md.
cmd/idlebench (#2002) measures the cost of idle clients against a tgtest cluster.
Layer 234 (#1990).
Fixes
- A connection that keeps receiving data is no longer closed on a late pong (#2003).
- Key exchange steps 5 and 7 honour
ExchangeTimeout; a peer that stopped answering there parked the client forever (#1838, by @pylakey). bad_server_saltfor a ping no longer logs "rpc callback not set" at Warn level about hourly on every connection (#2010).CancellableGroup.Waitreleases its context; repeated reconnect failures leaked contexts (#1859, by @true-seeker).- Dialogs iterator: the offset peer comes from the last dialog with a peer, so a page ending on a
dialogCommunityno longer stops it (#1981, by @bardrop), and the total counts dialogs, not messages (#2000). Client.DCandClient.MediaOnlypass the test DC flag to their connections (#1988, by @anri217).uploader.FromReaderuses the remaining size of in-memory readers (#1992, by @AmanBoronbaev).- 64-bit atomics are aligned on 32-bit platforms (#1985 by @fatshotty, #1997).
CheckDHremembers primes that passed, saving about 250 ms of CPU per key exchange (#1989, by @Cigarrr).
Full Changelog: v0.166.1...v0.167.0