I think I remember why I made the agent periodic inventory scan one hour :)
Right now, every time the agent does a scan, it takes the newly discovered inventory and
completely overwrites the old inventory with the new. It's the same scan the agent
does at startup. This means (in the current implementation) if we discover 200 resources,
we send all 200 to inventory (even if nothing changed!). Even though we try to use the
inventory bulk/ REST API, we still send multiple requests (we end up splitting up into
multiple bulk/ requests - might send 5 resources one time, 2 another, 10 another... its
the way the current implementation works) and this means it takes a long time to finish. I
haven't looked at the numbers recently, but it wouldn't surprise me if it takes
longer than 10 minutes for the inventory bulk/ requests to finish. So changing the scan to
happen every 10 minutes might mean the agent will continuously be sending bulk/ requests.
The second problem is that when resources DO change, and the agent puts the already
existing-but-changed resources in its inventory, when it sends those resources to
hawkular-inventory via bulk/ those resources aren't updated. Inventory will see the
resources already exist, and just return a 409 and not change anything. Lukas said he is
going to change that behavior (such that when you send a resource to inventory it will do
a create-or-update for the caller, rather than the caller do a double round trip (send a
create, receive a 409, send an update, receive a 201). I don't know when that will be
in place (Lukas?) but I don't think it works like that now.
So what am I saying? Doing a periodic scan will really only benefit you if a NEW resource
was added to the WF hierarchy. If one was updated (say, a resource configuration property
value changed) the UI won't see that change because it never gets updated into
inventory.
I'm working on trying to figure out how to change the implementation to fix these
problems. So right now, think we should keep the scan interval at 1 hour, unless we are
doing a demo that needs to find new resources quickly. You can change that setting in
"autoDiscoveryScanPeriodSecs" attribute in the agent's <subsystem>
element in standalone.xml. Setting it to 0 disables auto-scans.
Show replies by date