Page MenuHomeDevCentral

Make innodb_buffer_pool_size configurable per node
Needs ReviewPublic

Authored by ptdradmin on Tue, Jul 21, 04:15.
Tags
None
Referenced Files
F37701330: D4135.id10845.diff
Tue, Jul 21, 22:31
F37701327: D4135.id10844.diff
Tue, Jul 21, 22:31
F37692656: D4135.id10844.diff
Tue, Jul 21, 21:53
F37678044: D4135.diff
Tue, Jul 21, 20:39
F37670040: D4135.id10845.diff
Tue, Jul 21, 20:04
F37666789: D4135.diff
Tue, Jul 21, 19:46
F37635280: D4135.diff
Tue, Jul 21, 16:37
F37550244: D4135.diff10844.diff
Tue, Jul 21, 04:19
Subscribers
None

Details

Summary

I checked roles/dbserver-mysql/mysql-server/files/conf.d/server.cnf
and found innodb_buffer_pool_size hardcoded to 410M. T1130 asks to
bump it to 2G, computed from Ysul's InnoDB data/index size with the
sizing query given in the task.

Before just swapping the value, I noticed this same server.cnf is
shared by every node running the dbserver-mysql role: ysul, windriver
and db-b-001 (see top.sls). 2G was only computed for Ysul, so I ran
the same query on windriver to check: its InnoDB tables hold about
32KB of data, basically unused (Postgres is the real DB there), and
windriver already runs a lot of other services (Grafana, Prometheus,
Redis, Nextcloud, webserver-alkane...). Hardcoding 2G everywhere would
have wasted RAM on windriver for nothing. I don't have access to check
db-b-001, so I'm leaving it on the current default too.

So instead of a one-line hardcode, I made the value configurable per
node through pillar, following the same pattern cnf.sls already uses
for nodename/listen_ip/use_zfs:

  • pillar/dbserver/ysul.sls: new pillar file setting dbserver_mysql:server:innodb_buffer_pool_size to 2G, wired into pillar/top.sls under ysul (it had no dbserver.* pillar before).
  • cnf.sls: pass innodb_buffer_pool_size into the template context via pillar.get, defaulting to 410M when unset.
  • server.cnf: use the templated value instead of the hardcoded one.

windriver and db-b-001 keep 410M (current behavior, unchanged) since
neither has this pillar key set. Whoever has access to db-b-001 can
run the T1130 query there and add pillar/dbserver/db-b-001.sls the
same way if a bump turns out to be justified.

Refs T1130

Test Plan

Rendered the cnf.sls context change mentally against the existing
nodename/listen_ip/use_zfs pattern - same pillar.get/default idiom,
no new dependency. Confirmed via SSH on windriver that its InnoDB
dataset is ~32KB and its currently effective innodb_buffer_pool_size
is 429916160 bytes (~410M), matching the unmodified default this
change preserves. Next step once deployed: confirm on ysul that
SHOW VARIABLES LIKE 'innodb_buffer_pool_size' reports 2G after a
highstate + MariaDB restart.

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Skipped
Unit
No Test Coverage
Branch
main
Build Status
Buildable 6760
Build 7048: arc lint + arc unit

Event Timeline

ptdradmin updated this revision to Diff 10845.

Scope the diff to the T1130 commit only, the previous version wrongly included the unrelated T2289 (D4134) change from the same local branch.

dereckson requested changes to this revision.Tue, Jul 21, 20:19
dereckson added inline comments.
pillar/top.sls
60 ↗(On Diff #10845)

Already declared in tower.sls - pillar/dbserver/ysul.sls will be found automatically by this line:

- dbserver/{{ minion_id }}.sls

So no need to declare it here.

This revision now requires changes to proceed.Tue, Jul 21, 20:19

pillar/tower.sls already auto-loads dbserver/{{ minion_id }}.sls for every minion via salt-tower, so pillar/dbserver/ysul.sls alone is enough.