-
-
Notifications
You must be signed in to change notification settings - Fork 122
Improve performance
If SnappyMail feels very slow or sluggish we need to find out why that is. Using the full debug mode and analyzing the log, you may find the issue and probably a solution.
- Go to
Admin -> Config
and find the optiondebug
and turn it on. Then at the bottom hit theSave
button. - Open a new browser tab and login with an email account.
- When fully loaded go back to Admin and turn off the
debug
mode to prevent noise of other logging.
Open the log at _data_/_default_/logs/*.txt
and we will walk you through the process.
IMAP[INFO]: Start connection to "tcp://localhost:143"
IMAP[DEBUG]: 0.00046396255493164 (raw connection)
This is the time it took to make a connection with the server.
IMAP[INFO]: < * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.\r\n
IMAP[DEBUG]: 0.0017571449279785 (*)
This is the time it took to the connection and get the first response from the server.
If the response doesn't have [CAPABILITY
, the next question to the server is IMAP[INFO]: > TAG CAPABILITY\r\n
to get all capabilities.
Now the connection is fully set and we go ask the server to STARTTLS or AUTHENTICATE.
IMAP[INFO]: > TAG AUTHENTICATE PLAIN Base64==\r\n
IMAP[DEBUG]: 0.27842593193054 (TAG)
This is the time it took to login on the server.
Now each additional request is the same way:
IMAP[INFO]: > TAG ....\r\n
IMAP[INFO]: < ...\r\n
IMAP[DEBUG]: 0.27842593193054 (TAG)
And finally it ends with the LOGOUT and the total time it took.
IMAP[INFO]: Disconnected from "tcp://localhost:143" (success)
IMAP[DEBUG]: 0.28226494789123454 (net session)
- Go to Admin -> Domains -> "the domain"
- In the
Disable capabilities
section checkLIST-STATUS
- Hit the save button at the bottom
RFC 5819 LIST-STATUS is a way to return a lot of info instantly from the IMAP server. This way SnappyMail only has to do 1 request to the IMAP server to fetch all required information of all folders. When the IMAP server is slow (for whatever reason) this kind of request can take a very long time. With the above setting you disable the feature and SnappyMail has to do several requests on the background (depends on on the amount of folders).
- Go to Admin -> Domains -> "the domain"
- In the
Disable capabilities
section checkMETADATA
- Hit the save button at the bottom
The folders METADATA is fetched to support RFC 5464, RFC 6154 and Kolab. With the above setting you disable the feature and SnappyMail has no support to check for comments nor special-use nor integrate with Kolab.
- Go to Admin -> Domains -> "the domain"
- In the
Disable capabilities
section checkSTATUS SIZE
- Hit the save button at the bottom
With STATUS SIZE each folder size is calculated by the IMAP software.
- Go to Admin -> Domains -> "the domain"
- In the
Disable capabilities
section checkSORT
- Hit the save button at the bottom
Sorting relies on the smart capabilities of the IMAP software. When it is slow, this speeds things up, but does disable the sorting features.
- Go to Admin -> Domains -> "the domain"
- In the
Disable capabilities
section checkTHREAD
- Hit the save button at the bottom
When fetching the messages list SnappyMail can combine messages in a thread. This relies on the smart capabilities of the IMAP software. When it is slow, this speeds things up, but does disable the threaded view features.
- https://github.com/the-djmaze/snappymail/issues/724
- https://github.com/the-djmaze/snappymail/issues/1071
- https://github.com/the-djmaze/snappymail/issues/1303
You can speed this up using ElasticSearch https://github.com/filiphanes/fts-elastic