-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mailwatch_milter_relay: very long execution time and high sql load #1265
Comments
Hi @dneuhaeuser That would make for a good optimization, I believe. This process has never been super efficient. I am open to ideas. |
I'm currently working on improving this scripts performance... On an installation with about ~500 emails in the mail.log (filesize ~2,5 MB) |
Just bear in mind under normal conditions --refresh should only be run once, preferrably after a logrotate even. I look forward to your improvements. |
please look at the PR #1266 it is a very simple change but effective: probably there is still room for more optimization... the cron file ('tools/Postfix_relay/mailwatch-milter-relay') executes the script hourly with --refresh EDIT: there is actually a suggestion for the 'tail' mode in 'INSTALL.milter'
I wonder why this method is not used in the suggested cron-file
|
@dneuhaeuser you are right, we need to fix that discrepancy. I actually use a systemd unit for this. It may make even more sense for us to include both a cron with the tail method and a systemd unit file that also uses the tail method. |
When running 'mailwatch_milter_relay.php' I observed that a run with '--refresh' (e.g. via cron) takes longer and longer, rising while mail.log is growing, from several minutes ultimatively to hours.
In this time there are very high loads on the mysql process.
When looking at the script I ask myself whether the code from line 143 onward really needs to be executed for each and every line in the logfile (each execution of function 'process_entries').
MailWatch/tools/Postfix_relay/mailwatch_milter_relay.php
Line 143 in ca1d81b
I believe it should probably be sufficient to run the codelines 143-163 only ONCE AFTER all logfile lines are processed.
All necessary informations for this are in the $idqueue array, right?
The text was updated successfully, but these errors were encountered: