Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Recommended Posts

Posted

I would like to share the results of an experiment: how much a subscription to events costs. It turned out that the cost is not as small as we might expect.

It reminds me of the results from another experiment - comparing access time to a QuickApp field (self.anyvariable) versus a local variable (or a global not bound to an object) - and how significant the difference is.

 

This is graph of normal, not very heavy loaded system:

Please login or register to see this attachment.

 

This is the same system with as low as 100 subscriptions added. Only catch the event and invoke near empty callback for every event. Empty house, nothing particular is happening...

Please login or register to see this attachment.

 

And a test code:

Please login or register to see this code.

 

Posted (edited)

Well, when you run them in one QA you only run one core at a time (it may jump between cores as your graph shows)
Running them on multiple QAs would spread the load more even and even out the graph. Point is, there is no reason to run multiple Refresh subscribers in one QA.
The number of callbacks (and thus work) also depends on how many events your system generates. 
Also when you press one core like that it starts to "trash" a bit - 30 subscriber gives a smaller smother curve.

 

So, I wouldn't worry about having ~30 QAs using refreshSubscriber on the the system - people have a tendency to write QAs that eat much more cpu on less useful things...

But yes, one should be careful with the resources on the HC3.
One approach is to have a single QA doing the refresh subscriptions and hand them out to the other QAs, like

 

and here is another one from the year before

 

Edited by jgab
  • Topic Author
  • Posted

     

    W dniu 9.09.2025 o 00:18, jgab napisał:

    So, I wouldn't worry about having ~30 QAs using refreshSubscriber on the the system - people have a tendency to write QAs that eat much more cpu on less useful things...

    This is the voice of reason.

    My code was only an example. However, some kind of even simple System Monitor (not only a plot, not telling much) would be very useful in an environment with reasonably limited resources. No more guessing which QA is pushing the CPU so high. If anyone from Fibaro Company is reading this, consider it my suggestion.

     

    Please login or register to see this attachment.

    Posted

    I did this some years ago.

    but will of course not work with encrypted QAs...

    • Like 1
  • Topic Author
  • Posted

    Interesting. This forum thread is a real goldmine of knowledge.
    I joined to forum two+ years ago and never have enough time to read through it all - however it’s definitely worth it.

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...