Is it safe to use the same DB file for multiple inputs? #8488
-
|
Pretty much as per title: Is it safe to use the same DB file for multiple inputs? I've tried it and it seems to be fine in that it stores offsets of the files of multiple inputs. I'd still be interested to know if I'm supposed to use it that way or if one database file per input is "the way". |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
|
I think it works by inode so the only complication would be if you're tailing the same file in multiple inputs then you won't get a per-input offset. |
Beta Was this translation helpful? Give feedback.
-
|
+1 to this question |
Beta Was this translation helpful? Give feedback.
-
|
I would like to update the old answer that it is not safe, as of testing in v3.1.10. The specific issue is that there is a cleanup procedure that will make |
Beta Was this translation helpful? Give feedback.
-
|
Using the same DB file for multiple inputs is generally safe but with important caveats. The SQLite DB file in Fluent Bit is used for two purposes:
Safe to share: multiple tail inputs can point to the same DB file. Fluent Bit uses separate SQLite tables per input plugin, so there's no key collision. Potential issues:
Recommendation: for < 10 tail inputs, a shared DB file is fine. For many inputs at high throughput, consider splitting into per-input DB files to avoid lock contention: [INPUT]
Name tail
Path /var/log/app1/*.log
DB /var/fluent-bit/app1.dbIs your concern specifically about correctness (will logs be duplicated/dropped) or performance? |
Beta Was this translation helpful? Give feedback.
I think it works by inode so the only complication would be if you're tailing the same file in multiple inputs then you won't get a per-input offset.