[Bro-Dev] [JIRA] (BIT-1547) broctl sets the same state variables over and over
Daniel Thayer (JIRA)
jira at bro-tracker.atlassian.net
Mon Mar 7 05:51:01 PST 2016
[ https://bro-tracker.atlassian.net/browse/BIT-1547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=24700#comment-24700 ]
Daniel Thayer commented on BIT-1547:
------------------------------------
How much faster does it get after adding the "if self.state.get(key)" check?
And how many workers are you using?
> broctl sets the same state variables over and over
> --------------------------------------------------
>
> Key: BIT-1547
> URL: https://bro-tracker.atlassian.net/browse/BIT-1547
> Project: Bro Issue Tracker
> Issue Type: Problem
> Components: BroControl
> Affects Versions: git/master
> Reporter: Justin Azoff
> Assignee: Daniel Thayer
>
> I happened to notice broctl check on one of our test boxes was slow. traced it to sqlite commits() being very slow. Then noticed that broctl seems to call set_state() with the same key, val over and over again... once for each worker.. so a few thousand sets just to run broctl check.
> Changing set_state to
> {code}
> # Set a dynamic state variable.
> def set_state(self, key, val):
> key = key.lower()
> if self.state.get(key) == val:
> return
> self.state[key] = val
> self.state_store.set(key, val)
> {code}
> Seemed to mostly fix it, aside from this:
> {code}
> Set manager-port to 47760
> Set manager-port to 47761
> Set manager-port to 47760
> Set manager-port to 47761
> Set manager-port to 47760
> Set manager-port to 47761
> Set manager-port to 47760
> Set manager-port to 47761
> Set manager-port to 47760
> Set manager-port to 47761
> Set manager-port to 47760
> Set manager-port to 47761
> {code}
> any idea why that is flipping around like that?
> We should possibly add a way for broctl to update state vars without calling commit where it knows it will be setting a large number of state vars in a loop.
--
This message was sent by Atlassian JIRA
(v7.2.0-OD-03-012#72000)
More information about the bro-dev
mailing list