diff options
author | Michael Weiser <michael.weiser@gmx.de> | 2019-04-17 10:14:26 +0000 |
---|---|---|
committer | Michael Weiser <michael.weiser@gmx.de> | 2019-04-25 12:20:20 +0000 |
commit | d75934c90dc55febbe7d49fc282ca599ffacf10b (patch) | |
tree | 74dcb4b051daa7bea575da0207c34f23b642d89c | |
parent | 41d65dab0f05b5551af496dfd2381c43b8f3eb15 (diff) |
Lower default for in-flight lock staleness
Lower the default for when to consider an in-flight lock of another
instance as stale from one hour to 15 minutes to speed up recovery at
the price of potential redundant analysis in case an instance is
legitimately very busy.
-rw-r--r-- | peekaboo.conf.sample | 2 | ||||
-rw-r--r-- | peekaboo/config.py | 2 | ||||
-rw-r--r-- | peekaboo/db.py | 2 | ||||
-rwxr-xr-x | test.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/peekaboo.conf.sample b/peekaboo.conf.sample index 34d08f8..7728b92 100644 --- a/peekaboo.conf.sample +++ b/peekaboo.conf.sample @@ -92,7 +92,7 @@ # number of seconds after which in-flight markers of samples are to be # removed/ignored, assuming that the instance processing them has crashed or # been shut down. -#stale_in_flight_threshold: 3600 +#stale_in_flight_threshold: 900 # Interval in which to check if other instances of a Peekaboo cluster have # finished processing samples we have held. diff --git a/peekaboo/config.py b/peekaboo/config.py index acba03d..c26ab8c 100644 --- a/peekaboo/config.py +++ b/peekaboo/config.py @@ -304,7 +304,7 @@ class PeekabooConfig(PeekabooConfigParser): self.cuckoo_exec = '/opt/cuckoo/bin/cuckoo' self.cuckoo_submit = '/opt/cuckoo/bin/cuckoo submit' self.cluster_instance_id = 0 - self.cluster_stale_in_flight_threshold = 1*60*60 + self.cluster_stale_in_flight_threshold = 15*60 self.cluster_duplicate_check_interval = 60 # section and option names for the configuration file. key is the above diff --git a/peekaboo/db.py b/peekaboo/db.py index e7331ae..8525f04 100644 --- a/peekaboo/db.py +++ b/peekaboo/db.py @@ -148,7 +148,7 @@ class AnalysisJournal(Base): class PeekabooDatabase(object): """ Peekaboo's database. """ def __init__(self, db_url, instance_id=0, - stale_in_flight_threshold=1*60*60, + stale_in_flight_threshold=15*60, log_level=logging.WARNING): """ Initialize the Peekaboo database handler. @@ -176,7 +176,7 @@ class TestDefaultConfig(unittest.TestCase): self.assertEqual(self.config.cuckoo_url, 'http://127.0.0.1:8090') self.assertEqual(self.config.cuckoo_poll_interval, 5) self.assertEqual(self.config.cluster_instance_id, 0) - self.assertEqual(self.config.cluster_stale_in_flight_threshold, 3600) + self.assertEqual(self.config.cluster_stale_in_flight_threshold, 15*60) self.assertEqual(self.config.cluster_duplicate_check_interval, 60) |