maria-discuss team mailing list archive
-
maria-discuss team
-
Mailing list archive
-
Message #06296
Re: MariaDB server horribly slow on start
-
To:
Gordan Bobic <gordan.bobic@xxxxxxxxx>
-
From:
Cédric Counotte <cedric.counotte@xxxxxxxxxx>
-
Date:
Thu, 28 Jul 2022 08:24:25 +0000
-
Accept-language:
en-US, fr-FR
-
Arc-authentication-results:
i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=1check.com; dmarc=pass action=none header.from=1check.com; dkim=pass header.d=1check.com; arc=none
-
Arc-message-signature:
i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b0sj88Z0UE+owKc3kV2pHrH3ns96DKJ6ATAlja3Zo9M=; b=IErjzbmf2IgU4fucrun/xDM692KMOtaVsVZh1Q4bje5Ctfoe7HJvm0ZszPffvFClqmg2FJLNngevO5a3YcQZ3TblKnmEtCymDIz29wJRovKYTAot+FGCXwdXGgUAPG3Jw+eEwk/PPWRJ8vAkAT+A948Y2zR9kzx2IBxGENh9qz/aIcYQiiMg384vBkcI7SbIvKEdN2P0Wwn/Mu3dRlFrL2QNoaU8/lwkk4gdr9g3/SM7HiEwYfV62ydRb8V3Ey0qjM0oy1/9/oVrX5otn5w9vdtDzA7tEjiVDESOWl5NUaa2nzBGOTRdIfiD/R/yqvluLmATk72MC9wSqZ+iEdjAKQ==
-
Arc-seal:
i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZYQErf7akEc0XeNXOEr4p3Efomq3PxmcdKMEF03z2jOIUaqjc8+B5Y9AIf3bbvaGSpccglTBWUGGphDICvch8aQMJzUv+5lAHeGgplUVvwu0tLUFJi1OhQyQNu/Ec4VjtUVrP8pPpWS2I3TX55jRuz/XnEwJ0pCofm0LTSWhZYLfHZmqNYotRo9/gx+GJSjZq9RpNgvMagWX/1v+0fCt8JetdZR94KX0+QD0rYDxGie4WqJ3eSFE7V1TDeY9TQkvGqPaIZ3ENt87OywvMdjuPc5OOXA6+g6r6TdI28hHag9uF1mT8j6kiW/fNdcYcmk6KxkKB5rw6HN16U+H1dST5Q==
-
Authentication-results:
dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=1check.com;
-
Cc:
Mailing-List mariadb <maria-discuss@xxxxxxxxxxxxxxxxxxx>, Pierre LAFON <pierre.lafon@xxxxxxxxxx>
-
In-reply-to:
<CAMx4oe0ZJX9Zy2T9vydC-chq6ayioU1MQhGSsOUmaLVi0fsGFQ@mail.gmail.com>
-
Thread-index:
Adihm/U8OcwjLBOASdqVrFuHw0ZWfgAA2yMAAAGY8HAAAKBwgAAACDYQAADYM4AAAW/DgAAAviOAAAAlMaAAAVHfAAAAUy3AACNvW4AAAafkQAACOgSAAABWiJA=
-
Thread-topic:
[Maria-discuss] MariaDB server horribly slow on start
I've prepared all servers with that new setting, and this (is it ok or should I set it to 1048576 as well?):
table_open_cache = 65536
I'll do the server restart this evening to avoid creating problems during the day.
I did try to restart the backup cluster (2 nodes, one slave of the main cluster) and it didn't seem to slowdown the slave as it used to, so that might be the solution (or part of)!
Thanks a lot for your time, will keep you posted later today when I restart a node of the main cluster.
-----Message d'origine-----
De : Gordan Bobic <gordan.bobic@xxxxxxxxx>
Envoyé : jeudi 28 juillet 2022 10:06
À : Cédric Counotte <cedric.counotte@xxxxxxxxxx>
Cc : jocelyn fournier <jocelyn.fournier@xxxxxxxxx>; Marko Mäkelä <marko.makela@xxxxxxxxxxx>; Mailing-List mariadb <maria-discuss@xxxxxxxxxxxxxxxxxxx>; Pierre LAFON <pierre.lafon@xxxxxxxxxx>
Objet : Re: [Maria-discuss] MariaDB server horribly slow on start
On Thu, Jul 28, 2022 at 10:56 AM Cédric Counotte <cedric.counotte@xxxxxxxxxx> wrote:
>
> Concerning table_open_cache, it’s currently set to 13869 (however in config it’s set to 16384), global status shows this on new node, 9 hours after start:
That means you are out of file handles at systemd level.
systemctl edit mariadb
and add this to the override file:
[Service]
LimitNOFILE=1048576
systemctl daemon reload
systemctl restart mariadb
Yes, this will probably trigger the problem you are having, but with some luck it may make it better in the future.
Do that on all nodes.
> +-----------------------------------+---------+
>
> | Table_open_cache_active_instances | 1 |
>
> | Table_open_cache_hits | 2136757 |
>
> | Table_open_cache_misses | 185097 |
>
> | Table_open_cache_overflows | 146153 |
>
> +-----------------------------------+---------+
>
> +---------------+--------+
>
> | Opened_tables | 159629 |
>
> +---------------+--------+
>
>
>
> I’ve updated table_open_cache to 65536 on 2 servers and the cache_overflows stops increasing.
>
>
>
> In /usr/lib/systemd/system/mariadb.service, I see those:
>
> LimitNOFILE=32768
That is way too low. This needs to be big enough to cover the sum total of:
max_connections
table_open_cache x2 (because innodb_open_files is separate)
There is generally no harm in bumping LimitNOFILE much higher on modern kernels.
> So I don’t understand why MariaDB decided to reduce the configured value? Not sure if changing the config will have any effect on the live value either? I’ll try to set both to 65536 this evening and see if it helps.
Because it tries to make sure that your total of the above mentioned settings fits in the number of file handles it has available to it.
> Is it safe to increase both limits? Maybe to the value I use during mariabackup, which is 919200?
Yes, see above. But it requires a daemon-reload and a restart of the service to take effect.
> All active nodes are used for writing, the HTTP load is spread evenly on all nodes. The ratio is 1.2% writes at 7780 read/sec with 125 write/sec on peak. Both read/writes are spread upon all active nodes using a load balancer using round-robin at the moment.
That is likely a part of your problem.
You should never ever use more than one Galera node for writing at a time.
Performance will be WORSE than performance of a single node, and you will get deadlocks all over the place.
You can use any of them for reading, but you should never use more than one at a time for writing.
It is a little concerning that you managed to get as far as putting Galera into production for months without full awareness of this.
> During yesterday’s test the existing 2 nodes where active at first. Seeing the queries starting to be stuck I decided to activate the new node to spread the load in hope for some improvements, however it just made things even worse, so I deactivated it again.
The more writable nodes you have the worse the performance will get.
There should only ever be one writable node at a time.
Follow ups
References
-
MariaDB server horribly slow on start
From: Cédric Counotte, 2022-07-27
-
Re: MariaDB server horribly slow on start
From: William Edwards, 2022-07-27
-
Re: MariaDB server horribly slow on start
From: Cédric Counotte, 2022-07-27
-
Re: MariaDB server horribly slow on start
From: Gordan Bobic, 2022-07-27
-
Re: MariaDB server horribly slow on start
From: Cédric Counotte, 2022-07-27
-
Re: MariaDB server horribly slow on start
From: Gordan Bobic, 2022-07-27
-
Re: MariaDB server horribly slow on start
From: Marko Mäkelä, 2022-07-27
-
Re: MariaDB server horribly slow on start
From: Gordan Bobic, 2022-07-27
-
Re: MariaDB server horribly slow on start
From: Cédric Counotte, 2022-07-27
-
Re: MariaDB server horribly slow on start
From: jocelyn fournier, 2022-07-27
-
Re: MariaDB server horribly slow on start
From: Cédric Counotte, 2022-07-27
-
Re: MariaDB server horribly slow on start
From: Gordan Bobic, 2022-07-28
-
Re: MariaDB server horribly slow on start
From: Cédric Counotte, 2022-07-28
-
Re: MariaDB server horribly slow on start
From: Gordan Bobic, 2022-07-28