mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-03-11 08:55:31 +00:00
extremely speedup of all database operations:
- (synchronous = OFF) write data through OS without syncing - (journal_mode = MEMORY) use memory for the transaction logging
This commit is contained in:
parent
34ae0b916e
commit
db9e724038
1 changed files with 5 additions and 2 deletions
|
|
@ -182,8 +182,11 @@ class Fail2BanDb(object):
|
|||
raise
|
||||
|
||||
cur = self._db.cursor()
|
||||
cur.execute("PRAGMA foreign_keys = ON;")
|
||||
|
||||
cur.execute("PRAGMA foreign_keys = ON")
|
||||
# speedup: write data through OS without syncing (no wait):
|
||||
cur.execute("PRAGMA synchronous = OFF")
|
||||
# speedup: transaction log in memory, alternate using OFF (disable, rollback will be impossible):
|
||||
cur.execute("PRAGMA journal_mode = MEMORY")
|
||||
try:
|
||||
cur.execute("SELECT version FROM fail2banDb LIMIT 1")
|
||||
except sqlite3.OperationalError:
|
||||
|
|
|
|||
Loading…
Reference in a new issue