CentOS 7.9 出現Redis server went away 錯誤

閱讀時間約 2 分鐘

最近使用CentOS當作Redis Server一段時間就會出現redis server went away

優化

vi /etc/rc.d/rc.local

if test -f /sys/kernel/mm/transparent_hugepage/enabled; then

echo never > /sys/kernel/mm/transparent_hugepage/enabled

fi

if test -f /sys/kernel/mm/transparent_hugepage/defrag; then

echo never > /sys/kernel/mm/transparent_hugepage/defrag

fi

存檔 chmod +x /etc/rc.d/rc.local


vi /etc/sysctl.conf

vm.overcommit_memory = 1

net.ipv4.ip_local_port_range = 1024 65535

net.core.rmem_max=16777216

net.core.wmem_max=16777216

net.ipv4.tcp_rmem=4096 87380 16777216

net.ipv4.tcp_wmem=4096 65536 16777216

net.ipv4.tcp_fin_timeout = 10

net.ipv4.tcp_tw_recycle = 1

net.ipv4.tcp_timestamps = 0

net.ipv4.tcp_window_scaling = 0

net.ipv4.tcp_sack = 0

net.core.netdev_max_backlog = 30000

net.ipv4.tcp_no_metrics_save=1

net.core.somaxconn = 5000

net.ipv4.tcp_syncookies = 0

net.ipv4.tcp_max_orphans = 262144

net.ipv4.tcp_max_syn_backlog = 262144

net.ipv4.tcp_synack_retries = 2

net.ipv4.tcp_syn_retries = 2

fs.file-max = 6553560

重開機即可

僅為工作上的紀錄
留言0
查看全部
發表第一個留言支持創作者!
Jerry CHU的工作日誌 的其他內容
安裝官方 nginx 先在/etc/yum.repos.d新增一個nginx.repo的檔案 並加入以下內容 [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgc
vi /etc/nginx/conf.d/default.conf # IPv4 allow 103.21.244.0/22; allow 103.22.200.0/22; allow 103.31.4.0/22; allow 104.16.0.0/13; allow 104.24.0.0/14;
vi /root/php-fpm.sh #!/bin/bash php_url="http://localhost/hscheck.php" RESULT='curl -I $php_url | grep "HTTP/1.1 502"' if [ -n "$RESULT" ]; then
安裝官方 nginx 先在/etc/yum.repos.d新增一個nginx.repo的檔案 並加入以下內容 [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgc
vi /etc/nginx/conf.d/default.conf # IPv4 allow 103.21.244.0/22; allow 103.22.200.0/22; allow 103.31.4.0/22; allow 104.16.0.0/13; allow 104.24.0.0/14;
vi /root/php-fpm.sh #!/bin/bash php_url="http://localhost/hscheck.php" RESULT='curl -I $php_url | grep "HTTP/1.1 502"' if [ -n "$RESULT" ]; then
你可能也想看
Google News 追蹤
Thumbnail
本專欄將提供給您最新的市場資訊、產業研究、交易心法、精選公司介紹,以上內容並非個股分析,還請各位依據自身狀況作出交易決策。歡迎訂閱支持我,獲得相關內容,也祝您的投資之路順遂! 每年 $990 訂閱方案👉 https://reurl.cc/VNYVxZ 每月 $99 訂閱方案👉https://re
遇到問題: root@b10000ea1f5b:/app/backend# ollama run phi3:14b pulling manifest pulling 7a3cc4804c64... 98% ▕███████████████████████████████████████ ▏
Thumbnail
進到管理介面更新就完成了……..沒甚麼可以多說的。
Thumbnail
Redis被稱為「資料結構伺服器」,因為其中的值(Value)可以是字串(String)、雜湊(Hash)、清單(List)、集合(Set)和有序集合(Sorted Set)等類型。 安裝 下載 wget https://download.redis.io/release/redis-6.
Thumbnail
本專欄將提供給您最新的市場資訊、產業研究、交易心法、精選公司介紹,以上內容並非個股分析,還請各位依據自身狀況作出交易決策。歡迎訂閱支持我,獲得相關內容,也祝您的投資之路順遂! 每年 $990 訂閱方案👉 https://reurl.cc/VNYVxZ 每月 $99 訂閱方案👉https://re
遇到問題: root@b10000ea1f5b:/app/backend# ollama run phi3:14b pulling manifest pulling 7a3cc4804c64... 98% ▕███████████████████████████████████████ ▏
Thumbnail
進到管理介面更新就完成了……..沒甚麼可以多說的。
Thumbnail
Redis被稱為「資料結構伺服器」,因為其中的值(Value)可以是字串(String)、雜湊(Hash)、清單(List)、集合(Set)和有序集合(Sorted Set)等類型。 安裝 下載 wget https://download.redis.io/release/redis-6.