From 25ddaa31f99e7291579c60f4acdfec15c7c7f18a Mon Sep 17 00:00:00 2001 From: Alyson Deives Pereira Date: Tue, 3 Jan 2023 17:50:39 -0300 Subject: [PATCH] Set max open file limit for sm service The sm process initializes with the default limit for the maximum number of open files. If somehow this default value is set to a high value, performance degradation can occur. For instance, the sm_service_action_run method from sm_service_action.c contains a for loop that closes file descriptors up to this limit. To avoid performance degradation, this change sets the limit for the maximum open files to 1024 using the systemd property LimitNOFILE. TEST PLAN: PASS: Confirm that 1024 is the max open file limit in /proc//limits. Story: 2010087 Task: 47102 Signed-off-by: Alyson Deives Pereira Change-Id: Iff848da7461a8b644057e9f58c69fa2d78499226 --- service-mgmt/sm/scripts/sm.service | 1 + 1 file changed, 1 insertion(+) diff --git a/service-mgmt/sm/scripts/sm.service b/service-mgmt/sm/scripts/sm.service index 1c46068f..e27d3dfb 100644 --- a/service-mgmt/sm/scripts/sm.service +++ b/service-mgmt/sm/scripts/sm.service @@ -13,6 +13,7 @@ PIDFile=/var/run/sm.pid KillMode=process RestartSec=10 Restart=on-failure +LimitNOFILE=1024 [Install] WantedBy=multi-user.target