mtproxy icon indicating copy to clipboard operation
mtproxy copied to clipboard

Add timeout.patch: Increase epoll timeout to 100ms.

Open gerasiov opened this issue 6 years ago • 1 comments

Current version of mtproxy consumes over 10% CPU time. See https://github.com/TelegramMessenger/MTProxy/issues/100

Increasing timeout to 100ms doesn't break mtproxy for small and medium size instances, but bring CPU consumption back to normal.

Signed-off-by: Alexander Gerasiov [email protected]

gerasiov avatar Jun 15 '18 08:06 gerasiov

Not sure it’s any right way to go. epoll_work() takes timeout parameter, seems it was intented to use for fetching, but not yet, at the same time there’s timeout2 value with time till next timer(?). Unfortunatelly first one is same 1ms, second is small too ~2ms usually. Code is not finished here, and just increasing value for epoll_fetch_events() is a hack with unknown timers effect, not real fix. That’s why I didn’t make incomplete PR with similar changes.

themiron avatar Jun 15 '18 13:06 themiron