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
check-for-changes.sh performance concerns on NFS #2098
Comments
I found the same behavior with deleting emails. |
Supervisor logs for restarting postfix:
|
I finally found https://github.com/NorseGaud/docker-mailserver/blob/check-for-changes-performance/target/scripts/postfix-wrapper.sh which is doing while loops and sleeping and likely contributing to the issue. Looking for optimizations... |
Side note: delmailuser returns right away, and if I'm deleting a ton of emails postfix restarts multiple times. There is room to improve this by blocking issuing a restart right away if there is still a pending lock file? I dunno... |
It looks as if check-for-changes.sh is the issue here. It should have a delay before it performs the updates and restarts services to ensure that a lot of changes all happening at once get a chance to settle. I think the PR I opened is a great first step to solve this. I was able to finally get the restart time down by using & and wait + changing sleeps to smaller amounts in the postfix-wrapper. |
This issue has become stale because it has been open for 20 days without activity. Remove the label and comment or this issue will be closed in 10 days. |
This issue was closed due to inactivity. |
This issue has become stale because it has been open for 20 days without activity. Remove the label and comment or this issue will be closed in 10 days. |
This issue was closed due to inactivity. |
Subject
#2096 sparked my interest in this. The addmailuser script seems to be a bit slow for some users (NFS mostly):
Ok, so this is understandable due to the following code I added in one of my last PRs:
This code assists with NFS or other slow volumes in use by the mail server. We could debate why slow volumes are being used, but I'll save that for another ticket :)
So, with all of this said, it doesn't actually seem as if slow volumes are actually the main cause of the root problem. The root problem seems to be that
check-for-changes.sh
takes much too long to update what it needs to. I therefore did some digging in a forked branch: https://github.com/NorseGaud/docker-mailserver/commits/check-for-changes-performanceHere are the results while running a modified
check-for-changes.sh
that outputs run time and STDOUT/ERR:for n in {1..10}; do ./usr/local/bin/addmailuser test${n}@pierce.us XXXXX; done
in the running container in my production setup using NFS. Thecheck-for-changes.sh
was only modified to show the run time, and no other changes were made:All other emails added took ~18 seconds.
check-for-changes.sh
runs, does a wait for each PID (wait "${WAIT_FOR_PIDS[*]}"
), and then letssupervisorctl restart
commands happen. The results were exactly the same, indicating to me that postfix/dovecot restarting was the primary target for the delay. I commented the dovecot restart out and found that actually postfix itself took ~15 seconds to restart ON THE SECOND RESTART.While parallelization of certain things in
check-for-changes.sh
might be a good idea, postfix's restart time is crazy long.I'm going to dig into if there is anything we can do about this, but I wanted to post it here for the community to also make some recommendations.
The text was updated successfully, but these errors were encountered: