-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
SUMMARY
The Syslog processing loop performs numerous database round-trips, particularly during the preprocessing phase where it searches for an available uniqueID for batching.
Existing pattern in syslog_preprocess_incoming_records:
- Loop and execute
SELECT COUNT(*)repeatedly with random IDs until a 0 count is returned. - Update the
syslog_incomingtable with the selected ID.
WHY REFACTOR
On high-volume systems, the repeated count queries add unnecessary latency to the polling cycle. Furthermore, many delete and optimization queries are executed unconditionally without verifying if data actually exists to be processed.
PROPOSED CHANGE
- Efficient ID Generation: Replace the indefinite loop with a bounded retry loop and more efficient
EXISTSorLIMIT 1checks. - Conditional Optimization: Wrap maintenance tasks (OPTIMIZE, TRUNCATE) in checks to ensure they only run when appropriate.
- Query Tuning: Review and optimize JOIN patterns in
syslog_remove_itemsto ensure indexes are used effectively.
SCOPE
- Optimization of
syslog_preprocess_incoming_recordsinfunctions.php. - Refactoring of table maintenance logic.
- Performance verification via poller logs.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels