В ASP.NET Core сервисе растёт хвост задержек и паузы GC. Профилировщик показывает миллионы аллокаций byte[]/MemoryStream в сети/серилизации на горячем пути. Как перепроектировать ввод/вывод, чтобы сделать его low-alloc/почти zero-copy, и какие подводные камни учесть?
Перейти на System.IO.Pipelines (PipeReader/PipeWriter) и парсинг через ReadOnlySequence<byte>/SequenceReader<byte>; писать в IBufferWriter<byte> вместо конкатенаций и ToArray(). Временные буферы брать из ArrayPool<byte>/MemoryPool<byte> (IMemoryOwner<byte>) и возвращать в finally. Не удерживать Span<T> через await (переносить как Memory<T>), уважать backpressure (AdvanceTo, FlushAsync), ограничивать параллелизм. Минимизировать boxing/LINQ на горячем пути, использовать source-generated сериализацию. Проверить ETW/EventCounters и бенчмарки, валидировать, что аллокации и tail-latency упали.
В ASP.NET Core сервисе растёт хвост задержек и паузы GC. Профилировщик показывает миллионы аллокаций byte[]/MemoryStream в сети/серилизации на горячем пути. Как перепроектировать ввод/вывод, чтобы сделать его low-alloc/почти zero-copy, и какие подводные камни учесть?
Перейти на System.IO.Pipelines (PipeReader/PipeWriter) и парсинг через ReadOnlySequence<byte>/SequenceReader<byte>; писать в IBufferWriter<byte> вместо конкатенаций и ToArray(). Временные буферы брать из ArrayPool<byte>/MemoryPool<byte> (IMemoryOwner<byte>) и возвращать в finally. Не удерживать Span<T> через await (переносить как Memory<T>), уважать backpressure (AdvanceTo, FlushAsync), ограничивать параллелизм. Минимизировать boxing/LINQ на горячем пути, использовать source-generated сериализацию. Проверить ETW/EventCounters и бенчмарки, валидировать, что аллокации и tail-latency упали.
In handing down the sentence yesterday, deputy judge Peter Hui Shiu-keung of the district court said that even if Ng did not post the messages, he cannot shirk responsibility as the owner and administrator of such a big group for allowing these messages that incite illegal behaviors to exist. The initiatives announced by Perekopsky include monitoring the content in groups. According to the executive, posts identified as lacking context or as containing false information will be flagged as a potential source of disinformation. The content is then forwarded to Telegram's fact-checking channels for analysis and subsequent publication of verified information. Ng Man-ho, a 27-year-old computer technician, was convicted last month of seven counts of incitement charges after he made use of the 100,000-member Chinese-language channel that he runs and manages to post "seditious messages," which had been shut down since August 2020. Ng was convicted in April for conspiracy to incite a riot, public nuisance, arson, criminal damage, manufacturing of explosives, administering poison and wounding with intent to do grievous bodily harm between October 2019 and June 2020. A few years ago, you had to use a special bot to run a poll on Telegram. Now you can easily do that yourself in two clicks. Hit the Menu icon and select “Create Poll.” Write your question and add up to 10 options. Running polls is a powerful strategy for getting feedback from your audience. If you’re considering the possibility of modifying your channel in any way, be sure to ask your subscribers’ opinions first.
from us