I noticed that POP/IMAP clients had huge delays in mail delivery, whereas Exchange accounts worked just fine.
After some investigations, I found out that mysql refused sporadically connections from gromox:
2024-08-22 15:51:33 13 [Warning] Aborted connection 13 to db: 'grommunio' user: 'grommunio' host: 'localhost' (Got an error reading communication packets)
2024-08-22 15:51:33 14 [Warning] Aborted connection 14 to db: 'grommunio' user: 'grommunio' host: 'localhost' (Got an error reading communication packets)
2024-08-22 15:51:33 32 [Warning] Aborted connection 32 to db: 'grommunio' user: 'grommunio' host: 'localhost' (Got an error reading communication packets)
2024-08-22 15:51:33 18 [Warning] Aborted connection 18 to db: 'grommunio' user: 'grommunio' host: 'localhost' (Got an error reading communication packets)
2024-08-22 15:51:33 17 [Warning] Aborted connection 17 to db: 'grommunio' user: 'grommunio' host: 'localhost' (Got an error reading communication packets)
2024-08-22 15:51:33 33 [Warning] Aborted connection 33 to db: 'grommunio' user: 'grommunio' host: 'localhost' (Got an error reading communication packets)
2024-08-22 15:51:33 35 [Warning] Aborted connection 35 to db: 'grommunio' user: 'grommunio' host: 'localhost' (Got an error reading communication packets)
2024-08-22 15:51:33 34 [Warning] Aborted connection 34 to db: 'grommunio' user: 'grommunio' host: 'localhost' (Got an error reading communication packets)
2024-08-22 15:51:33 31 [Warning] Aborted connection 31 to db: 'grommunio' user: 'grommunio' host: 'localhost' (Got an error reading communication packets)
2024-08-22 15:51:33 30 [Warning] Aborted connection 30 to db: 'grommunio' user: 'grommunio' host: 'localhost' (Got an error reading communication packets)
2024-08-22 15:51:33 25 [Warning] Aborted connection 25 to db: 'grommunio' user: 'grommunio' host: 'localhost' (Got an error reading communication packets)
2024-08-22 15:51:33 26 [Warning] Aborted connection 26 to db: 'grommunio' user: 'grommunio' host: 'localhost' (Got an error reading communication packets)
2024-08-22 15:51:33 12 [Warning] Aborted connection 12 to db: 'grommunio' user: 'grommunio' host: 'localhost' (Got an error reading communication packets)
I've made multiple MySQL configs for other projects, so here's my take to fix this issue:
Create new file /etc/my.cnf.d/grommunio_tuning.cnf
with following content:
[mysqld]
# NETPERFECT-BZ012: Optimisation des performances mono serveur
table_cache = 1000
innodb_buffer_pool_size = 1G
read_rnd_buffer_size = 8M
sort_buffer_size = 8M
# NETPERFECT-BZ131: Permet l'import de fichiers SQL disposant de INSERT statements trop longs (ERROR 2006 (HY000) at line 696: MyS>
max_allowed_packet = 256M
# NETPERFECT-BZ065: Augmenter la taille du fichier log INNODB pour permetttre de jouer de plus grandes requêtes (info: MySQL serve>
innodb_log_file_size = 256M
# NETPERFECT-BZ213: Augmenter la durée maximale d'absence de requête pour éviter l'erreur (MySQL server has gone away)
wait_timeout = 288000
# NETPERFECT-BZ003: Chaque table INNODB doit posséder son propre fichier afin de faciliter la récuperation de données en cas de cr>
innodb-file-per-table = 1
# NETPERFECT-BZ511: En cas d'erreur Got timeout reading communication packets, augmenter les délais
net_read_timeout=3600
net_write_timeout=3600
Restart mysql with service restart mysql
Warning: restarting mysql will temporarily (10s) make your mail server respond 451 deferred to incomming messages.
After this, I did not encounter the mysql error anymore, and mails are not delayed anymore either.
Hope this might help someone.
Notes: These are my own tuning settings I carry between various mysql instances.
Perhaps the cache sizes and other tunables need to be set according to your server's workloads.
Also, @grommunio Perhaps this config or alike could make it into a next release ?
Mit Freundliche Grüsse / Best regards
Orsiris de Jong.
Tested with gromox-2.30.106.gf1d7ee1-lp155.7.1.x86_64 on latest OpenSuSE Leap 15.6.
Also references this older community thread