mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-07-21 20:41:25 +02:00
bicep/mysql: enable hugepages
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
let
|
let
|
||||||
cfg = config.services.mysql;
|
cfg = config.services.mysql;
|
||||||
dataDir = "/data/mysql";
|
dataDir = "/data/mysql";
|
||||||
|
|
||||||
|
innodbBufferPoolMB = 128;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ ./backup.nix ];
|
imports = [ ./backup.nix ];
|
||||||
@@ -26,6 +28,10 @@ in
|
|||||||
# Useful for the mysqld prometheus exporter
|
# Useful for the mysqld prometheus exporter
|
||||||
userstat = 1;
|
userstat = 1;
|
||||||
|
|
||||||
|
# Memory settings
|
||||||
|
innodb_buffer_pool_size = "${toString innodbBufferPoolMB}M";
|
||||||
|
"large-pages" = 1;
|
||||||
|
|
||||||
# This was needed in order to be able to use all of the old users
|
# This was needed in order to be able to use all of the old users
|
||||||
# during migration from knakelibrak to bicep in Sep. 2023
|
# during migration from knakelibrak to bicep in Sep. 2023
|
||||||
secure_auth = 0;
|
secure_auth = 0;
|
||||||
@@ -47,6 +53,10 @@ in
|
|||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
boot.kernel.hugepages.reservations.mysql = lib.mkIf cfg.enable (
|
||||||
|
builtins.ceil (innodbBufferPoolMB / config.boot.kernel.hugepages.size)
|
||||||
|
);
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = lib.mkIf cfg.enable [ 3306 ];
|
networking.firewall.allowedTCPPorts = lib.mkIf cfg.enable [ 3306 ];
|
||||||
|
|
||||||
systemd.tmpfiles.settings."10-mysql".${dataDir}.d = lib.mkIf cfg.enable {
|
systemd.tmpfiles.settings."10-mysql".${dataDir}.d = lib.mkIf cfg.enable {
|
||||||
|
|||||||
Reference in New Issue
Block a user