-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
Reduce polling frequency of usb serial scanner #889
Conversation
Signed-off-by: Björn Brings <[email protected]>
Let's wait for a comment of the initial author. |
Related to: eclipse-archived/smarthome#5315 @hsudbrock Can you comment? |
Thanks for the ping, Markus; I am only on phone now, will answer when I get to laptop later.
Am 21. Juni 2019 08:27:49 MESZ schrieb Markus Rathgeb <[email protected]>:
…Related to: eclipse-archived/smarthome#5315
@hsudbrock Can you comment?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#889 (comment)
|
The reasons why I set the default polling frequency to 5 seconds were
If CPU consumption has become an issue, and the default USB polling frequency needs to be reduced because this issue is a problem for too many users, I think that it should be fine to set the default to 60 secs; if a user (or a solution integrating the USB discovery) wants faster feedback, the frequency can be configured to another value (as far as I recall, I made most settings for the USB discovery configurable via OSGi config admin). |
Without digging into the current implementation... would it be possible if we introduce a "serial interface scanner" Java interface that every implementation publishes as an OSGi service. Don't know if this makes sense at all. |
@bjoernbrings Looking at the numbers of #829, it does not seem to be "high" resource usage by this thread - it is similar to the ssh server thread, which is also just some background thread. I see the point of @hsudbrock that it is nice to get a direct feedback (auto-discovery) when a USB dongle is plugged in - 60 seconds would very much destroy this user experience. On the other side, it is a very rare activity, which might not be worth having a permanent background activity. Maybe 10-15 seconds could be a compromise? And there were discussions about fully disabling background discovery for "fully set up systems" - so this could solve the second point above. |
10-15 seconds seems quite reasonable, as the user won't get impatient when the device isn't discovered quickly. Plus, it really is very simple to change the value to something large enough to make the CPU consumption blend into the background noise. Thanks to @hsudbrock who had the foresight to make it configurable. 👍 I have mine set to this, and it's way, way down on the list of CPU-consuming threads -- effectively disabled for all practical purposes... And, as you know, I've been looking at this list of threads a lot lately. 🙄
|
|
|
Thank you. |
Signed-off-by: Björn Brings <[email protected]>
Fine for me, adjusted as suggested. |
@maggu2810 I am not quite sure if I understand what your goal is here. Are you talking about having something like a "USB/Serial interface scanning service" that could be used by bindings directly, instead of "forcing" the bindings to plug into the current USB/Serial discovery service? If I understand this correctly then I think that, technically, this should be possible. |
@hsudbrock I realized that I did not answer your question yet. As it has been already merged I assume we can leave the situation as it is. |
* Reduce polling frequency Signed-off-by: Björn Brings <[email protected]> GitOrigin-RevId: 7fdef07
As discussed in a side discussion in issue #829 the most CPU consumption (after #763 and #861 have been implemented) is the USB polling.
I'd propose to reduce the polling frequency from 5 to 60 sec.
Signed-off-by: Björn Brings [email protected]