mtproxy
mtproxy copied to clipboard
Add timeout.patch: Increase epoll timeout to 100ms.
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]
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.