-
Notifications
You must be signed in to change notification settings - Fork 287
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
storage: remove 500 ms debounce on IMAP IDLE notifications #216
base: main
Are you sure you want to change the base?
Conversation
This commit removes hardcoded 500 ms debounce from storage that delays all storage notification subscribers such as IDLE and NOTIFY commands. 500 ms debounce constant NOTIFY_DELAY_MSECS was added in 2009 [1]. Before that Dovecot was only delivering notifications when a second-resolution timer is changed by at least 1, so IDLE notifications were delayed by half a second on average. [1] dovecot@56fb5d0
I have made a patch that actually deletes 500 ms delay I then looked into Then I thought about the issue again So unless there is an IMAP client See related issue at deltachat/chatmail#72 for the "chatmail" Postfix+Dovecot setup that needs reduced delay for chatting. |
This is now deployed on https://c20.testrun.org/ account and works without problems. |
The worry I have related to performance isn't about IMAP client behavior, but rather Dovecot's mailbox_sync() calls. With no delay IDLEing imap process would call mailbox_sync() every time there is a write to dovecot.index.log, whatever that reason is. If another sync is already running by another process, it would wait a bit for the exclusive lock, but otherwise it would be syncing as rapidly as there are .log file writes. Although syncing isn't necessarily expensive, it's not trivially cheap either. So this might increase the server's CPU usage. I'm not sure if that's more of a theoretical problem, but over the years I've grown to be wary of performance regressions, since they sometimes pop up rather unexpectedly. |
Without measuring I also cannot tell An option that was discussed in the mailing list I have another proposal. If nothing else works, |
If anyone wants to try this out, we are hosting this PR as a .deb build on https://build.opensuse.org/package/show/home:deltachat/dovecot so it is easy to install |
This commit removes hardcoded 500 ms debounce
from storage that delays all storage notification subscribers such as IDLE and NOTIFY commands.
500 ms debounce constant NOTIFY_DELAY_MSECS
was added in 2009 [1]. Before that Dovecot
was only delivering notifications
when a second-resolution timer
is changed by at least 1, so IDLE notifications
were delayed by half a second on average.
[1] 56fb5d0