From 219252de3e3c07b37f626f2175818788d1730681 Mon Sep 17 00:00:00 2001 From: Abhishek jaiswal Date: Mon, 24 Jul 2023 20:21:50 +0530 Subject: [PATCH] SCTP socket buffer settings 1) auto load the sctp module 2) configure the required network parameters To facilitate better network performance for SCTP network traffic and provide performance improvements for typical k8s application workloads the following network parameters need to be modified to the respective values. net.core.rmem_max - Defines the maximum receive window size. net.core.wmem_max - Defines the maximum send window size. net.sctp.rcvbuf_policy - Defines the socket receive buffer accounting policy. net.sctp.sndbuf_policy - Defines the socket send buffer accounting policy. Depends-On: https://review.opendev.org/c/starlingx/config-files/+/890503 Test Plan: PASS: SCTP autoload after iso installation on AIO-SX lsmod | grep sctp PASS: Configured values can be read through sysctl commands on AIO-SX sysctl net.core.rmem_max sysctl net.core.wmem_max sysctl net.sctp.rcvbuf_policy sysctl net.sctp.sndbuf_policy Story: 2010849 Task: 48508 Change-Id: I561f1d08d669114da7b59affb495b062fbacf83c Signed-off-by: ajaiswal --- .../stx-extensions/debian/deb_folder/rules | 3 +++ .../debian/deb_folder/stx-extensions.install | 3 +++ .../stx-extensions/files/modules-load-sctp.conf | 1 + .../files/net-core-sysctl-debian.conf | 11 +++++++++++ .../files/sctp-sysctl-debian.conf | 17 +++++++++++++++++ 5 files changed, 35 insertions(+) create mode 100644 utilities/stx-extensions/files/modules-load-sctp.conf create mode 100644 utilities/stx-extensions/files/net-core-sysctl-debian.conf create mode 100644 utilities/stx-extensions/files/sctp-sysctl-debian.conf diff --git a/utilities/stx-extensions/debian/deb_folder/rules b/utilities/stx-extensions/debian/deb_folder/rules index e2712e4c..180587a6 100755 --- a/utilities/stx-extensions/debian/deb_folder/rules +++ b/utilities/stx-extensions/debian/deb_folder/rules @@ -14,6 +14,8 @@ export LOCAL_ETC_MODLOAD = etc/modules-load.d override_dh_install: install -d -m 755 $(ROOT)/$(LOCAL_ETC_SYSCTL) install -p -D -m 644 coredump-sysctl-debian.conf $(ROOT)/$(LOCAL_ETC_SYSCTL)/50-coredump.conf + install -p -D -m 644 net-core-sysctl-debian.conf $(ROOT)/$(LOCAL_ETC_SYSCTL)/50-net-core.conf + install -p -D -m 644 sctp-sysctl-debian.conf $(ROOT)/$(LOCAL_ETC_SYSCTL)/50-net-sctp.conf install -d -m 755 $(ROOT)/$(LOCAL_ETC_COREDUMP) install -p -D -m 644 coredump.conf $(ROOT)/$(LOCAL_ETC_COREDUMP)/coredump.conf @@ -21,5 +23,6 @@ override_dh_install: install -d -m 755 $(ROOT)/$(LOCAL_ETC_MODLOAD) install -p -D -m 644 modules-load-vfio.conf $(ROOT)/$(LOCAL_ETC_MODLOAD)/vfio.conf install -p -D -m 644 modules-load-intel-uncore-frequency.conf $(ROOT)/$(LOCAL_ETC_MODLOAD)/intel-uncore-frequency.conf + install -p -D -m 644 modules-load-sctp.conf $(ROOT)/$(LOCAL_ETC_MODLOAD)/sctp.conf dh_install diff --git a/utilities/stx-extensions/debian/deb_folder/stx-extensions.install b/utilities/stx-extensions/debian/deb_folder/stx-extensions.install index cbadeb4b..982345c4 100644 --- a/utilities/stx-extensions/debian/deb_folder/stx-extensions.install +++ b/utilities/stx-extensions/debian/deb_folder/stx-extensions.install @@ -1,4 +1,7 @@ etc/sysctl.d/50-coredump.conf +etc/sysctl.d/50-net-sctp.conf +etc/sysctl.d/50-net-core.conf etc/systemd/coredump.conf.d/coredump.conf etc/modules-load.d/vfio.conf +etc/modules-load.d/sctp.conf etc/modules-load.d/intel-uncore-frequency.conf diff --git a/utilities/stx-extensions/files/modules-load-sctp.conf b/utilities/stx-extensions/files/modules-load-sctp.conf new file mode 100644 index 00000000..f79753cd --- /dev/null +++ b/utilities/stx-extensions/files/modules-load-sctp.conf @@ -0,0 +1 @@ +sctp diff --git a/utilities/stx-extensions/files/net-core-sysctl-debian.conf b/utilities/stx-extensions/files/net-core-sysctl-debian.conf new file mode 100644 index 00000000..0b2d22e8 --- /dev/null +++ b/utilities/stx-extensions/files/net-core-sysctl-debian.conf @@ -0,0 +1,11 @@ +# STX +# Linux Network Tuning for better performance + +# contains the maximum socket receive buffer size in bytes which a user may set +# by using the SO_RCVBUF socket option. +net.core.rmem_max=10485760 + +# contains the maximum socket send buffer size in bytes which a user may set by +# using the SO_SNDBUF socket option. +net.core.wmem_max=10485760 + diff --git a/utilities/stx-extensions/files/sctp-sysctl-debian.conf b/utilities/stx-extensions/files/sctp-sysctl-debian.conf new file mode 100644 index 00000000..bbd840d3 --- /dev/null +++ b/utilities/stx-extensions/files/sctp-sysctl-debian.conf @@ -0,0 +1,17 @@ +# STX +# See sctp(7) for Linux man page. +# Values set to provide performance improvements for typical k8s application +# workloads + +# This controls the socket sendbuffer accounting policy. The default value is 0 +# and indicates that all the associations belonging to a socket share the same +# send buffer space. When set to 1, each association will have its own send +# buffer space. +net.sctp.sndbuf_policy=1 + + +# This controls the socket receive buffer accounting policy. The default value +# is 0 and indicates that all the associations belonging to a socket share the +# same receive buffer space. When set to 1, each association will have its own +# receive buffer space. +net.sctp.rcvbuf_policy=1