diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-03-20 02:17:04 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-03-20 02:23:08 +0000 |
| commit | 0f5a0a8e2d43774288d4d6ea747278ca6e085a2a (patch) | |
| tree | 08878dff32a636b388c660fd3330f1bddbd98af3 /src/webstat_logger_main.cpp | |
| parent | 8c6fecd356003309f8eebec30374344272ca6072 (diff) | |
| download | webstat-0f5a0a8e2d43774288d4d6ea747278ca6e085a2a.tar.bz2 webstat-0f5a0a8e2d43774288d4d6ea747278ca6e085a2a.tar.xz webstat-0f5a0a8e2d43774288d4d6ea747278ca6e085a2a.zip | |
Insert log entries in batches
Store log lines in memory until threshold is reach or idle occurs, then
insert all the lines in a single transaction. Save points handle the
case of insertion errors. On success the queue is cleared.
Parked lines also saved in bulk, only necessary if queued lines could
not be inserted on shutdown, else the queue simply grows until ability
to insert is restored. Importing parked lines just adds them to the
queue and the normal process then follows.
Diffstat (limited to 'src/webstat_logger_main.cpp')
| -rw-r--r-- | src/webstat_logger_main.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/webstat_logger_main.cpp b/src/webstat_logger_main.cpp index 6d3aeda..39d794a 100644 --- a/src/webstat_logger_main.cpp +++ b/src/webstat_logger_main.cpp @@ -53,6 +53,8 @@ main(int argc, char ** argv) "Maximum number of concurrent write/read write DB connections") ("db.wr.keep", po::value(&settings.dbKeep)->default_value(settings.dbKeep), "Number of write/read write DB connections to keep open") + ("db.maxBatchSize", po::value(&settings.maxBatchSize)->default_value(settings.maxBatchSize), + "Maximum number of access log entries to hold in memory before writing them to the DB") ("fallback.dir", po::value(&settings.fallbackDir)->default_value(settings.fallbackDir), "Path to write access logs to when the database is unavailable") ("jobs.check", po::value(&settings.checkJobsAfter)->default_value(settings.checkJobsAfter), |
