-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid executor jump to resolve ip addresses #103
Conversation
Similar to #26 Avoids executor overload at statup with lots of esphome devices 2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.189, 6053, 0, 0, 6, 0), kwargs: {} 2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.248, 6053, 0, 0, 6, 0), kwargs: {} 2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.234, 6053, 0, 0, 6, 0), kwargs: {} 2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.206, 6053, 0, 0, 6, 0), kwargs: {} 2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.220, 6053, 0, 0, 6, 0), kwargs: {} 2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.61, 6053, 0, 0, 6, 0), kwargs: {} 2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.133, 6053, 0, 0, 6, 0), kwargs: {} 2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.3, 6053, 0, 0, 6, 0), kwargs: {} 2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.203, 6053, 0, 0, 6, 0), kwargs: {} 2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.178, 6053, 0, 0, 6, 0), kwargs: {} 2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.173, 6053, 0, 0, 6, 0), kwargs: {} 2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.106.243, 6053, 0, 0, 6, 0), kwargs: {} 2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.170, 6053, 0, 0, 6, 0), kwargs: {}
418eb05
to
5f3b37b
Compare
Tested on HASS Dev with manually upgrading to this version. My esphome devices still work and no executor use on startup |
Using a custom |
Reduced esphome startup time from |
😱 how many esphome devices do you have??? I know the threadpool isn't very fast (or rather the synchronization) but I never expected it to be that slow. Do you know how much latency I can expect from executor calls? |
The install I was testing on only had 42. The executor execution is really quick except when there are a lot of sync integrations competing for it at startup (or on installs that have a lot of sync integration updating frequently -- these are where we still have a major UX issue, and why I've been investing time in converting the top integrations to asyncio). If esphome is unlucky enough to startup when the executor is in an overload state everything would wait. Once we hit 64 workers everything grinds to a halt that is waiting for the executor even if the executor job itself will be quick because it may be in line behind one that is not. (https://github.com/home-assistant/core/blob/dev/homeassistant/runner.py#L28). With |
Similar to #26
Avoids executor overload at statup with lots of esphome devices
2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.189, 6053, 0, 0, 6, 0), kwargs: {}
2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.248, 6053, 0, 0, 6, 0), kwargs: {}
2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.234, 6053, 0, 0, 6, 0), kwargs: {}
2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.206, 6053, 0, 0, 6, 0), kwargs: {}
2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.220, 6053, 0, 0, 6, 0), kwargs: {}
2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.61, 6053, 0, 0, 6, 0), kwargs: {}
2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.133, 6053, 0, 0, 6, 0), kwargs: {}
2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.3, 6053, 0, 0, 6, 0), kwargs: {}
2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.203, 6053, 0, 0, 6, 0), kwargs: {}
2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.178, 6053, 0, 0, 6, 0), kwargs: {}
2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.173, 6053, 0, 0, 6, 0), kwargs: {}
2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.106.243, 6053, 0, 0, 6, 0), kwargs: {}
2021-09-17 07:34:00 DEBUG (MainThread) [homeassistant.util.executor] Calling executor with function: <function getaddrinfo at 0x7f96b7915a60>, args: (192.168.107.170, 6053, 0, 0, 6, 0), kwargs: {}