This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-15. For the latest, interactive version please visit https://mariadb.com/kb/.

MariaDB stop randomly : Got timeout reading communication packets

Hi,

I'm running a webserver which hosting 100 "small" websites (no very huge trafic). The mysql server is located on the same server than apache2 and nginx (for proxy) The server has got pretty good resources :

(Debian GNU/Linux 12 64bit / Linux 6.1.0-23-cloud-amd64)                                                                                                      Uptime: 4:13:53
Cloud cpu4-ram12-disk20-perf1 instance i-0000a405 (AZ1)

AMD EPYC-Rome Processor                                                  CPU ↑    27.7%  idle    64.2%  ctx_sw     2K      MEM -   23.7%  active   4.91G      SWAP -   0.0%      LOAD -  4core
CPU  [||||||||||||||||                                          27.7%]   user     21.1%  irq      0.0%  inter      2K      total   11.7G  inacti   3.48G      total       0      1 min    1.74
MEM  [|||||||||||||                                             23.7%]   system    9.1%  nice     0.0%  sw_int     2K      used    2.77G  buffer    814M      used        0      5 min    1.74
SWAP [                                                           0.0%]   iowait    5.4%  steal    0.0%                     free    8.92G  cached   6.34G      free        0      15 min   1.91

However, since few weeks, MariaDB crash randomly, approxymatively 3 times a week. On the logs, everytimes, I have a lot of lines like this for each DBs I host :

...
2024-08-13 23:13:30 100731 [Warning] Aborted connection 100731 to db: 'MSH_mairie' user: 'MSH_mairie' host: 'localhost' (Got timeout reading communication packets)
2024-08-13 23:13:39 101338 [Warning] Aborted connection 101338 to db: 'LUD_luda' user: 'LUD_luda' host: 'localhost' (Got timeout reading communication packets)
2024-08-13 23:13:39 100002 [Warning] Aborted connection 100002 to db: 'CGA_coco' user: 'CGA_coco' host: 'localhost' (Got timeout reading communication packets)
2024-08-13 23:13:39 101207 [Warning] Aborted connection 101207 to db: 'LGO_nespa' user: 'LGO_nespa' host: 'localhost' (Got timeout reading communication packets)
2024-08-13 23:13:39 100212 [Warning] Aborted connection 100212 to db: 'KCO_lady' user: 'KCO_lady' host: 'localhost' (Got timeout reading communication packets)
2024-08-13 23:13:39 101206 [Warning] Aborted connection 101206 to db: 'LGO_nespa' user: 'LGO_nespa' host: 'localhost' (Got timeout reading communication packets)
2024-08-13 23:13:40 101342 [Warning] Aborted connection 101342 to db: 'SSO_sano' user: 'SSO_sano' host: 'localhost' (Got timeout reading communication packets)
2024-08-13 23:13:40 101344 [Warning] Aborted connection 101344 to db: 'LGO_tef' user: 'LGO_tef' host: 'localhost' (Got timeout reading communication packets)
2024-08-13 23:13:51 99984 [Warning] Aborted connection 99984 to db: 'CDA_ecole' user: 'CDA_ecole' host: 'localhost' (Got timeout reading communication packets)
...

After some searches, I read the issue could comes from settings inside /etc/mysql/my.cnf, by increasing some values, but it’s look hard to know how exactly to find the correct values. In my case, I have changed these values :

max_allowed_packet = 256M  (instead of 32M)
wait_timeout=30 (instead of 10)
long_query_time=10 (instead of 5)

But unfortunatly, I steel have mysql server randomly stop.

I have checked the size of my DBs, and I have 4 or 5 upper to 300Mo, but pretty all others are smaller than 150Mo

I also have installed MySQLTuner to help me to fine tune the my.cnf file I have tried the results which it give it to me after analyse. But with the latest changes given from MySQLTunner, my server crash 2 or 3 a day !

So I came back to the previous my.cnf and I came here to get help because I really don't know how I can solve my issue with these random crashs :(

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.