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
Constant events=POLLIN -> CPU load #523
Comments
I would check which of those fds, if any, are the websocket fd. |
Does https://err.no/p/2018-03-10-V1Vioqnb6ys/stdin make it better for you? (Feel free to adjust the wanted_interval to something higher and see how that works.) |
Yes! That patch indeed does seem to impact the CPU load/strain quite a bit! |
Numbers above 1000 probably won't make stuff any better, we have other timers that fire at 1s intervals so you'll hit those. If 100 is ok and seems to work without side effects, I'll test that too and look at merging it. |
If there's more work, schedule ourselves more often, if there's less, back off a bit to lessen the CPU load. Fixes: #523
This definitely lowers the overall CPU usage. I'm trying it on my slow netbook computer, and the CPU usage dropped from 25% when idling to 5% idling. |
I've been merging and using the https://github.com/wee-slack/wee-slack/tree/adaptive-eventrouter-timer branch for a while now, and it makes a huge difference. Is there any reason why this hasn't been merged into the master branch? I'm assuming everyone would appreciate the extra CPU cycles. |
I'd love this as well, I'm using it on a bit more of a beefy computer but Weechat is still using 2-3% CPU all the time, which is a bit crazy to me. EDIT: Not a very scientific point of view, but I've run both Slack and wee-slack for a couple of hours now, and according to the Energy Monitor in macOS weechat is consuming more energy than Slack is, though it uses an order of magnitude less RAM. So it's a bit of a toss up. |
If there's more work, schedule ourselves more often, if there's less, back off a bit to lessen the CPU load. Fixes: #523
If there's more work, schedule ourselves more often, if there's less, back off a bit to lessen the CPU load. Fixes: wee-slack#523
I'm running wee-slack with legacy tokens (WeeChat 2.0.1/websocket-client (0.47.0)) and everything runs fine except my weechat process uses 2-5% of my CPU constantly . I have other (non-Slack) weechat instances on the same machine that don't have this problem, so I guess its related to the websocket?
Because when I strace my process, this comes flying across the screen 100s of times:
poll([{fd=5, events=POLLIN}, {fd=7, events=POLLIN}, {fd=0, events=POLLIN}, {fd=18, events=POLLIN}, {fd=10, events=POLLIN}, {fd=47, events=POLLIN}, {fd=15, events=POLLIN}], 7, 8) = 0 (Timeout)
fcntl(5, F_GETFD) = 0
fcntl(7, F_GETFD) = 0
fcntl(0, F_GETFD) = 0
fcntl(18, F_GETFD) = 0
fcntl(10, F_GETFD) = 0
fcntl(47, F_GETFD) = 0
fcntl(15, F_GETFD) = 0
Any tips how I can debug this further?
The text was updated successfully, but these errors were encountered: