From bf3fd8432e5f011a62eeed3f04dfd334e0de7ff2 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik <37010174+vitabaks@users.noreply.github.com> Date: Wed, 31 Aug 2022 20:34:45 +0300 Subject: [PATCH] comment out the "kernel.sched_migration_cost_ns" This tests did not show a significant difference before and after turning a process scheduler - https://gitlab.com/postgres-ai/postgresql-consulting/tests-and-benchmarks/-/issues/16 To really reduce the number of context switches: - try to minimize the number of idle connections to the database; - use the connections pool in transaction mode. in addition, this parameter is missing in ubuntu 22.04 Fixed: failed: [172.31.22.219] (item={'name': 'kernel.sched_migration_cost_ns', 'value': '5000000'}) => {"ansible_loop_var": "item", "changed": false, "item": {"name": "kernel.sched_migration_cost_ns", "value": "5000000"}, "msg": "Failed to reload sysctl: vm.overcommit_memory = 2\nvm.swappiness = 1\nvm.min_free_kbytes = 102400\nvm.dirty_expire_centisecs = 1000\nvm.dirty_background_bytes = 67108864\nvm.dirty_bytes = 536870912\nvm.zone_reclaim_mode = 0\nkernel.numa_balancing = 0\nsysctl: cannot stat /proc/sys/kernel/sched_migration_cost_ns: No such file or directory\n"} --- vars/system.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/system.yml b/vars/system.yml index dc9c4d0b8..beb3339f8 100644 --- a/vars/system.yml +++ b/vars/system.yml @@ -56,7 +56,6 @@ sysctl_conf: # - {name: "vm.nr_hugepages", value: "9510"} # example "9510"=18GB - {name: "vm.zone_reclaim_mode", value: "0"} - {name: "kernel.numa_balancing", value: "0"} - - {name: "kernel.sched_migration_cost_ns", value: "5000000"} - {name: "kernel.sched_autogroup_enabled", value: "0"} - {name: "net.ipv4.ip_nonlocal_bind", value: "1"} - {name: "net.ipv4.ip_forward", value: "1"} @@ -66,6 +65,7 @@ sysctl_conf: - {name: "net.core.somaxconn", value: "65535"} - {name: "net.ipv4.tcp_tw_reuse", value: "1"} # - {name: "net.netfilter.nf_conntrack_max", value: "1048576"} +# - {name: "kernel.sched_migration_cost_ns", value: "5000000"} # - {name: "", value: ""} balancers: - {name: "net.ipv4.ip_nonlocal_bind", value: "1"}