Thursday, 2022-10-20

opendevreviewArnaud Morin proposed openstack/large-scale master: Move configuration guidelines  https://review.opendev.org/c/openstack/large-scale/+/86210011:43
opendevreviewArnaud Morin proposed openstack/large-scale master: Move configuration guidelines  https://review.opendev.org/c/openstack/large-scale/+/86210012:12
amorinhey felixhuettner[m] and other large-scalers, I was wondering if you had a specific configuration on sql pool_size and other related config params?12:14
amorinhttps://docs.openstack.org/nova/latest/configuration/config.html#database.max_pool_size12:14
amorinwe are using mariadb on our side, some of our biggest regions are consuming a LOT of SQL connection to the DB12:15
amorinI am not yet sure why, but I have the feeling that some tuning needs to be done on that part12:15
felixhuettner[m]we have some tuning on our mariadb-galera side that we could share12:16
felixhuettner[m]on the openstack service side its mostly about the connections we want to hold open12:16
amorinthat would be awecome12:16
felixhuettner[m]allthough thats more random guessing of what works best (since there is no metrics for that)12:16
amorinwe see sometimes in our neutron logs that the workers reached the pool limit12:17
amorinespecially under heavy load12:17
amorinI cant understand that, as I was expecting each worker having it's own pool12:18
amorinand avoid consuming more RPC messages when the pool limit is reached12:18
felixhuettner[m]yep i think so too12:18
felixhuettner[m]these should all be separate processes12:18
amorinin what I can see, the workers are still consuming messages even if there is no more connection in the pool12:19
amorinhave you seen such things?12:19
amorinin your deployment?12:19
felixhuettner[m]not that i know of12:19
amorinack12:19
felixhuettner[m]we have max_pool_siz 15and max_overflow 25 set12:19
felixhuettner[m]and a gigantic amount of workers12:20
amorindo you monitor the number of connection on the DB?12:20
felixhuettner[m]i think over all neutron-api instances we are at 300 workers :D12:20
felixhuettner[m]yep, give me a sec what we have there effectively12:20
amorinwe have something similar, we reduced the pool size (and overflow) to lower the number of connection on the DB, because of RAM issue12:20
amorinanyway, having something like 4k connections only for neutron services is huge12:21
amorinand seems like a bad behavior/design to me12:21
felixhuettner[m]it's around 1k connections to neutron database12:21
felixhuettner[m]and i guess most of your's are idle as well?12:22
amorin300 workers with 15+2512:22
amorinyou can reach something like 1050012:22
amorinin theory12:22
felixhuettner[m]yep, glady that never happened :D12:22
amorinit happened to us unfortunately12:22
amorine.g. restart all neutron agents in a shot12:23
amorinor: imagine a drop on RPC, all agents a reviving and doing a full sync at the same time12:23
felixhuettner[m]we had that a few times (as we killed our whole rabbit clusters)12:24
felixhuettner[m]there it spiked up to 1.600 connections12:24
amorinhow many computes do you have?12:24
amorincomputes/agent12:24
felixhuettner[m]roughly 40012:24
felixhuettner[m]and a few more agents for l312:24
amorinok12:25
amorinwe have a region with more than 2k, with 2 ovs agents, 1 l3 agent and few dhcp agents12:26
felixhuettner[m]poor 1 l3 agent :)12:26
amorin1 l3 per compute12:26
felixhuettner[m]what did you set for `connection_recycle_time`?12:26
felixhuettner[m]ooooh, ok thats a lot :)12:26
amorinour db suffered a lot12:27
amorinfor connection_recycle_time we just lower it a little bit, something like 55 minutes12:27
amorinwhat about you?12:27
felixhuettner[m]ok, we have 280 seconds12:27
amorinwaw12:27
amorinso you are recycling connections a lot12:28
felixhuettner[m]maybe that helps to keep them down12:28
amorinfor sure12:28
felixhuettner[m]but it heavily helps us to do failovers of databases12:28
amorinwhat about the overhead to establish the connection?12:28
felixhuettner[m]since we just need a few min to drain12:28
amorinmake sense12:29
felixhuettner[m]we did not notice something yet, allthough we might not have detailed enough data12:29
amorinok, that's a good point anyway, I'll consider changing this12:29
felixhuettner[m]and our haproxy in front of the galera cluster has a connection timeout of 300 seconds, so we don't drop things there12:30
amorinwe set this timeout to 1H IIRC, that's why we lower it a little bit12:30
felixhuettner[m]+112:30
felixhuettner[m]do you also run a galera cluster?12:31
felixhuettner[m]or native mariadb?12:31
amorinyup12:31
amoringalera12:31
felixhuettner[m]do you also set `gcomm.thread_prio` under `wsrep_provider_options`?12:32
amorinhum good question12:32
felixhuettner[m]that is the biggest stability gain for our galera cluster that we found12:33
amorinI cant see anything like that on our deployment12:33
felixhuettner[m]did your galera cluster ever break because of a lot of connections?12:33
felixhuettner[m]because it missed heartbeats?12:34
amorinyes we had such issues12:34
felixhuettner[m]you will want12:34
felixhuettner[m]`wsrep_provider_options=gcomm.thread_prio=rr:2`12:34
felixhuettner[m]but then you need to start the database with CAP_NICE12:34
felixhuettner[m]then the replication thread gets realtime priority set12:34
felixhuettner[m]and client connections don't break the replication anymore12:35
felixhuettner[m](depending on your kernel settings you might need some cgroup magic)12:35
amorinnice!12:35
felixhuettner[m]i guess i'll write that up for the docs12:36
amorinnice tip, maybe it could be worth to add that to the docs12:36
amorinyou were faster :)12:36
opendevreviewFelix Huettner proposed openstack/large-scale master: Add guide for galera configuration  https://review.opendev.org/c/openstack/large-scale/+/86214113:11
felixhuettner[m]there you go13:11
felixhuettner[m]would be interested where you see differences13:13
amorinnice, thanks! I will talk with the team about this, and I will let you know20:15

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!