Skip to content

Commit 03c3bbb

Browse files
committed
[tune] config all user ulimint in limits.conf
1 parent 47b39f6 commit 03c3bbb

File tree

2 files changed

+36
-10
lines changed

2 files changed

+36
-10
lines changed

scripts/tune_dingofs_rocky.sh

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/usr/bin/env bash
22
set -e
33

4+
# check time zone is Asia/Shanghai or not, if not, set it to Asia/Shanghai
5+
#if [ "$(timedatectl | grep "Time zone" | awk '{print $3}')" != "Asia/Shanghai" ]; then
6+
# echo "Setting time zone to Asia/Shanghai..."
7+
# sudo timedatectl set-timezone Asia/Shanghai
8+
#fi
9+
410
echo "Checking if 'tuned' package is installed..."
511
if ! rpm -q tuned &>/dev/null; then
612
echo "'tuned' is not installed. Installing now..."
@@ -73,11 +79,18 @@ sudo tuned-adm active
7379
current_user=$(whoami)
7480

7581
# Configure ulimit for the user
76-
LIMITS_FILE="/etc/security/limits.d/${current_user}.conf"
77-
echo "Configuring ulimit settings for user ${current_user} in $LIMITS_FILE"
78-
cat << EOF | sudo tee "$LIMITS_FILE"
79-
${current_user} soft nofile 65536
80-
${current_user} hard nofile 65536
82+
# LIMITS_FILE="/etc/security/limits.d/${current_user}.conf"
83+
# echo "Configuring ulimit settings for user ${current_user} in $LIMITS_FILE"
84+
# cat << EOF | sudo tee "$LIMITS_FILE"
85+
# ${current_user} soft nofile 65536
86+
# ${current_user} hard nofile 65536
87+
# EOF
88+
89+
# configue all user ulimit in /etc/security/limits.conf
90+
echo "Configuring ulimit settings in /etc/security/limits.conf"
91+
cat << EOF | sudo tee -a /etc/security/limits.conf > /dev/null
92+
* soft nofile 65536
93+
* hard nofile 65536
8194
EOF
8295

8396
# Apply ulimit settings immediately

scripts/tune_dingofs_ubuntu.sh

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/usr/bin/env bash
22
set -e
33

4+
# check time zone is Asia/Shanghai or not, if not, set it to Asia/Shanghai
5+
#if [ "$(timedatectl | grep "Time zone" | awk '{print $3}')" != "Asia/Shanghai" ]; then
6+
# echo "Setting time zone to Asia/Shanghai..."
7+
# sudo timedatectl set-timezone Asia/Shanghai
8+
#fi
9+
410
echo "Configuring system performance settings for DingoFS on Ubuntu..."
511

612
# Set CPU governor to performance
@@ -32,11 +38,18 @@ done
3238
current_user=$(whoami)
3339

3440
# Configure ulimit for the user
35-
LIMITS_FILE="/etc/security/limits.d/${current_user}.conf"
36-
echo "Configuring ulimit settings for user ${current_user} in $LIMITS_FILE"
37-
cat << EOF | sudo tee "$LIMITS_FILE"
38-
${current_user} soft nofile 65536
39-
${current_user} hard nofile 65536
41+
# LIMITS_FILE="/etc/security/limits.d/${current_user}.conf"
42+
# echo "Configuring ulimit settings for user ${current_user} in $LIMITS_FILE"
43+
# cat << EOF | sudo tee "$LIMITS_FILE"
44+
# ${current_user} soft nofile 65536
45+
# ${current_user} hard nofile 65536
46+
# EOF
47+
48+
# configue all user ulimit in /etc/security/limits.conf
49+
echo "Configuring ulimit settings in /etc/security/limits.conf"
50+
cat << EOF | sudo tee -a /etc/security/limits.conf > /dev/null
51+
* soft nofile 65536
52+
* hard nofile 65536
4053
EOF
4154

4255
# Apply ulimit settings immediately

0 commit comments

Comments
 (0)