Announcement

Collapse
No announcement yet.

Imperihome crashing at startup

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by bsobel View Post
    Ok, at about 2 hours later the config page is working. It looks like the init thread needs to finish. The painful part was the 12370 calls to CAPIGetSingleControlByUse. is there any way those calls can be deferred until the data is needed? Perhaps only get it for enabled devices, and then get it later if a device gets enabled. I only have a dozen or so enabled devices so I suspect that would be a dramatic improvement. If not, calling to get all controls then walking the return array yourself will be much faster. Its taken HS about 518ms PER call, so about 107 minutes of time to do those 12370 calls. No idea what that call is so expensive on my system, most HS calls are much cheaper but all calls for your plugin seem high which usually means HS is spending lots of time doing something so the RCP call gets starved until HS completes what its doing. I wonder if the GetSingleControlByUse is expensively creating and then walking the list internally or something like that instead of having a cached version available.
    I could implement all kind of optimizations and workarounds, but the bottom line is that nothing is going to work well if a single call to get controls for a device takes 500ms.

    Comment


      #17
      Looks like it was caused by the MultiSwitch plugin.

      Comment


        #18
        Originally posted by spud View Post

        I could implement all kind of optimizations and workarounds, but the bottom line is that nothing is going to work well if a single call to get controls for a device takes 500ms.
        Actually not true. That just happens to be one of the most expensive calls. Your the only plugin I have that calls it like this in a loop at startup. If it was done just for enabled devices it would be no more that 20 seconds vs 2 hours. The SEL boxes just aren’t too beefy and HS has never made it clear in the SDK how some of these calls should be put together. But since your calling multiple times per device at least getting all controls in one call would eliminate the duplicative serialization and transfer overhead.

        Comment


          #19
          Originally posted by Leeros View Post
          Looks like it was caused by the MultiSwitch plugin.
          What are you referring to?

          Comment


            #20
            Ok I rebooted, now seeing a better response time from Hs. Appears to be an Hs bug that causes one of the HSConsole threads to get into a tight loop (reported to Rich with what data I could find), that starves everyone else of CPU time. That said, still hoping you will optimize out this call pattern where possible as it just eats CPU at startup when other plugins are struggling to get some. I found that with Autelis and TankUtil disabled this plugin runs pretty well (the GetDeviceEnumerator is a real killer and both those do it so much the CPU grinds and then other plugins see long call times)

            Timing: HSPI_ImperiHome.IHSApplication.CAPIGetSingleControlByUse Total Calls: 15030 Invoke: 1,390,500ms Deserialization: 6,628ms Total: 1,397,129ms Average: 92ms

            Comment


              #21
              Try 3.0.0.36: http://homeseer.com/updates3rd3/Impe...x_3-0-0-36.zip

              In this version there should be only one call to CAPIGetControlEx per device instead of five calls to CAPIGetSingleControlByUse.

              Comment


                #22
                Ok after installing and running for about 20 minutes I see:

                2438 calls to CAPIGetControlEx
                870 calls to CAPIGetSingleControlByUse

                So much lower numbers (so far) than prior. The previous version had hit 130,678 calls to CAPIGetSingleControlByUse (over a day or so). I will check in a few hours and update, but certainly at startup this seems much lower load on the system.

                Comment


                  #23
                  Originally posted by bsobel View Post
                  Ok after installing and running for about 20 minutes I see:

                  2438 calls to CAPIGetControlEx
                  870 calls to CAPIGetSingleControlByUse

                  So much lower numbers (so far) than prior. The previous version had hit 130,678 calls to CAPIGetSingleControlByUse (over a day or so). I will check in a few hours and update, but certainly at startup this seems much lower load on the system.
                  I replaced some more calls to CAPIGetSingleControlByUse by a single call to CAPIGetControlEx in version 3.0.0.37
                  http://homeseer.com/updates3rd3/Impe...x_3-0-0-37.zip

                  Comment

                  Working...
                  X