Loading views...
서버 최적화

서버 최적화

Date
Date
2020 Feb 11 0:0
Created by
Created by
Seonglae ChoSeonglae Cho
Created time
Created time
2023 Feb 28 12:39
Last edited by
Last edited by
Seonglae ChoSeonglae Cho
Last edited time
Last edited time
2023 Apr 15 16:50
Refs
Refs

의심


  • 캐시 사이즈
  • 프로파일링
  • 나스 성능
  • 네트워크 장애
 
 

방도


  • cgroup
  • cent server management
  • server profiling
 
[root@m701 /]# sar Linux 3.10.0-1062.9.1.el7.x86_64 (m701) 02/11/2020 _x86_64_ (8 CPU) 12:00:01 AM CPU %user %nice %system %iowait %steal %idle 12:10:01 AM all 0.75 0.00 0.68 1.59 0.00 96.98 12:20:01 AM all 0.76 0.00 0.62 1.25 0.00 97.37 12:30:02 AM all 0.76 0.00 0.61 1.16 0.00 97.47 12:40:01 AM all 0.78 0.00 0.66 1.24 0.00 97.32 12:50:01 AM all 0.75 0.00 0.62 1.07 0.00 97.57 01:00:01 AM all 0.76 0.00 0.57 0.97 0.00 97.70 01:10:01 AM all 0.75 0.00 0.58 0.88 0.00 97.79 01:20:01 AM all 0.75 0.00 0.60 1.12 0.00 97.52 01:30:01 AM all 0.80 0.00 0.53 0.56 0.00 98.12 01:40:01 AM all 0.74 0.00 0.58 0.85 0.00 97.83 01:50:01 AM all 0.78 0.00 0.65 0.90 0.00 97.67 02:00:01 AM all 0.74 0.00 0.54 0.60 0.00 98.12 02:10:01 AM all 0.67 0.00 0.43 0.43 0.00 98.47 02:20:01 AM all 0.69 0.00 0.48 0.67 0.00 98.16 02:30:01 AM all 0.65 0.00 0.41 0.49 0.00 98.45 02:40:01 AM all 0.64 0.00 0.39 0.60 0.00 98.38 02:50:01 AM all 0.60 0.00 0.32 0.37 0.00 98.70 03:00:01 AM all 0.62 0.00 0.34 0.38 0.00 98.66 03:10:02 AM all 0.60 0.00 0.30 0.28 0.00 98.82 03:20:01 AM all 0.61 0.00 0.31 0.31 0.00 98.77 03:30:01 AM all 0.61 0.00 0.32 0.21 0.00 98.86 03:40:01 AM all 0.58 0.01 0.30 0.20 0.00 98.90 03:50:01 AM all 0.58 0.00 0.27 0.16 0.00 98.98 04:00:01 AM all 0.58 0.00 0.27 0.16 0.00 98.99 04:10:01 AM all 0.61 0.00 0.33 0.26 0.00 98.79 04:20:01 AM all 0.58 0.00 0.25 0.10 0.00 99.07 04:30:01 AM all 0.58 0.00 0.27 0.16 0.00 98.99 04:40:01 AM all 0.59 0.00 0.26 0.11 0.00 99.04 04:50:01 AM all 0.59 0.00 0.26 0.10 0.00 99.05 05:00:01 AM all 0.58 0.00 0.26 0.11 0.00 99.06 05:10:01 AM all 0.60 0.00 0.27 0.13 0.00 99.00 05:20:01 AM all 0.57 0.00 0.25 0.11 0.00 99.07 05:30:01 AM all 0.59 0.00 0.30 0.22 0.00 98.89 05:40:01 AM all 0.58 0.00 0.25 0.12 0.00 99.05 05:50:01 AM all 0.58 0.00 0.26 0.12 0.00 99.04 06:00:01 AM all 0.57 0.00 0.24 0.09 0.00 99.11 06:10:01 AM all 0.59 0.00 0.27 0.11 0.00 99.03 06:20:01 AM all 0.57 0.00 0.23 0.09 0.00 99.12 06:30:01 AM all 0.56 0.00 0.23 0.08 0.00 99.13 06:40:01 AM all 0.59 0.00 0.26 0.10 0.00 99.05 06:50:01 AM all 0.58 0.00 0.27 0.14 0.00 99.01 07:00:01 AM all 0.58 0.00 0.27 0.12 0.00 99.03 07:10:01 AM all 0.59 0.00 0.26 0.10 0.00 99.06 07:20:01 AM all 0.56 0.00 0.24 0.12 0.00 99.08 07:30:01 AM all 0.58 0.00 0.26 0.15 0.00 99.01 07:40:01 AM all 0.64 0.00 0.34 0.18 0.00 98.84 07:50:01 AM all 0.61 0.00 0.31 0.18 0.00 98.89 08:00:01 AM all 0.58 0.00 0.29 0.18 0.00 98.95 08:10:01 AM all 0.63 0.00 0.32 0.18 0.00 98.87 08:20:01 AM all 0.62 0.00 0.34 0.22 0.00 98.82 08:20:01 AM CPU %user %nice %system %iowait %steal %idle 08:30:01 AM all 0.63 0.00 0.35 0.23 0.00 98.80 08:40:01 AM all 0.61 0.00 0.29 0.26 0.00 98.84 08:50:01 AM all 0.59 0.00 0.29 0.23 0.00 98.89 09:00:01 AM all 0.66 0.00 0.36 0.32 0.00 98.67 09:10:01 AM all 0.77 0.00 0.57 0.95 0.00 97.71 09:20:02 AM all 0.77 0.00 0.59 0.83 0.00 97.80 09:30:01 AM all 0.82 0.00 0.73 3.07 0.00 95.38 09:40:01 AM all 1.03 0.00 1.01 4.46 0.00 93.50 09:50:01 AM all 0.81 0.00 0.63 2.93 0.00 95.63 10:00:01 AM all 0.90 0.00 0.89 4.63 0.00 93.58 10:10:01 AM all 1.00 0.00 1.20 7.80 0.00 90.00 10:20:01 AM all 0.94 0.00 0.94 4.20 0.00 93.91 10:30:01 AM all 0.88 0.00 1.15 9.08 0.00 88.89 10:40:01 AM all 0.83 0.00 1.34 13.28 0.00 84.54 10:50:01 AM all 0.77 0.00 0.67 6.54 0.00 92.01 11:00:01 AM all 0.77 0.00 0.70 7.37 0.00 91.16 11:10:01 AM all 0.89 0.00 0.70 5.35 0.00 93.07 11:20:01 AM all 0.88 0.00 0.84 4.52 0.00 93.77 11:30:01 AM all 0.86 0.00 0.96 5.11 0.00 93.07 11:40:01 AM all 0.84 0.00 0.87 5.96 0.00 92.34 11:50:01 AM all 0.94 0.00 0.98 6.19 0.00 91.89 12:00:02 PM all 0.97 0.00 0.91 4.70 0.00 93.41 12:10:01 PM all 0.85 0.00 0.71 2.10 0.00 96.34 12:20:01 PM all 0.80 0.00 0.65 0.79 0.00 97.77 12:30:01 PM all 0.82 0.00 0.77 1.99 0.00 96.42 12:40:01 PM all 0.99 0.00 1.03 3.50 0.00 94.48 12:50:01 PM all 0.91 0.00 0.99 4.55 0.00 93.56 01:00:01 PM all 0.86 0.00 0.84 3.64 0.00 94.66 01:10:01 PM all 0.86 0.00 0.97 5.24 0.00 92.92 01:20:01 PM all 0.94 0.00 0.91 3.95 0.00 94.20 01:30:01 PM all 0.66 0.00 0.27 0.41 0.00 98.66 01:40:01 PM all 0.84 0.00 0.94 4.65 0.00 93.57 01:50:01 PM all 0.80 0.00 0.65 3.18 0.00 95.36 02:00:01 PM all 0.91 0.00 1.13 7.32 0.00 90.63 02:10:01 PM all 0.94 0.00 0.96 5.74 0.00 92.37 02:20:01 PM all 0.77 0.00 0.41 1.12 0.00 97.71 02:30:01 PM all 0.79 0.00 0.72 3.21 0.00 95.28 02:40:01 PM all 0.78 0.00 0.75 4.01 0.00 94.47 02:50:01 PM all 0.73 0.00 0.54 2.57 0.00 96.17 03:00:02 PM all 0.60 0.00 0.26 0.21 0.00 98.93 03:10:01 PM all 0.65 0.00 0.43 2.66 0.00 96.26 03:20:01 PM all 1.04 0.00 1.16 6.71 0.00 91.08 03:30:01 PM all 1.71 0.00 1.99 6.58 0.00 89.71 03:40:01 PM all 1.54 0.00 1.76 5.04 0.00 91.66 03:50:01 PM all 1.74 0.00 1.68 3.73 0.00 92.85 04:00:01 PM all 1.62 0.00 1.64 2.80 0.00 93.94 04:10:01 PM all 1.57 0.00 1.60 3.62 0.00 93.21 04:20:01 PM all 1.51 0.00 1.49 1.89 0.00 95.11 04:30:01 PM all 1.65 0.00 1.59 1.98 0.00 94.78 04:40:01 PM all 1.01 0.00 0.95 2.15 0.00 95.90 04:40:01 PM CPU %user %nice %system %iowait %steal %idle 04:50:01 PM all 1.21 0.00 1.80 2.63 0.00 94.36 Average: all 0.79 0.00 0.64 2.13 0.00 96.43
일단 cpu 사용량이 거의 없다 늘리고싶다
 
 
CentOS TCP 성능 튜닝 - Apache 성능 최대화
API World for Mobile Developers 잡동사니 API Prover Certification 미니렉스 2017. 6. 12. 17:09 웹서버 성능시험중에 발생한 오류 증상에 대하여 다양한(?)
CentOS TCP 성능 튜닝 - Apache 성능 최대화
[root@m701 /]# sysctl -a | grep net.core net.core.bpf_jit_enable = 1 net.core.bpf_jit_harden = 1 net.core.bpf_jit_kallsyms = 0 net.core.busy_poll = 0 net.core.busy_read = 0 net.core.default_qdisc = pfifo_fast net.core.dev_weight = 64 net.core.dev_weight_rx_bias = 1 net.core.dev_weight_tx_bias = 1 net.core.message_burst = 10 net.core.message_cost = 5 net.core.netdev_budget = 300 net.core.netdev_max_backlog = 1000 net.core.netdev_tstamp_prequeue = 1 net.core.optmem_max = 20480 net.core.rmem_default = 212992 net.core.rmem_max = 212992 net.core.rps_sock_flow_entries = 0 net.core.somaxconn = 128 net.core.warnings = 1 net.core.wmem_default = 212992 net.core.wmem_max = 212992 net.core.xfrm_acq_expires = 30 net.core.xfrm_aevent_etime = 10 net.core.xfrm_aevent_rseqth = 2 net.core.xfrm_larval_drop = 1
 
[root@m701 /]# sysctl -a | grep net.ipv4.tcp net.ipv4.tcp_abort_on_overflow = 0 net.ipv4.tcp_adv_win_scale = 1 net.ipv4.tcp_allowed_congestion_control = cubic reno net.ipv4.tcp_app_win = 31 net.ipv4.tcp_autocorking = 1 net.ipv4.tcp_available_congestion_control = cubic reno net.ipv4.tcp_base_mss = 512 net.ipv4.tcp_challenge_ack_limit = 1000 net.ipv4.tcp_congestion_control = cubic net.ipv4.tcp_dsack = 1 net.ipv4.tcp_early_retrans = 3 net.ipv4.tcp_ecn = 2 net.ipv4.tcp_fack = 1 net.ipv4.tcp_fastopen = 0 net.ipv4.tcp_fin_timeout = 60 net.ipv4.tcp_frto = 2 net.ipv4.tcp_invalid_ratelimit = 500 net.ipv4.tcp_keepalive_intvl = 75 net.ipv4.tcp_keepalive_probes = 9 net.ipv4.tcp_keepalive_time = 7200 net.ipv4.tcp_limit_output_bytes = 262144 net.ipv4.tcp_low_latency = 0 net.ipv4.tcp_max_orphans = 65536 net.ipv4.tcp_max_ssthresh = 0 net.ipv4.tcp_max_syn_backlog = 512 net.ipv4.tcp_max_tw_buckets = 65536 net.ipv4.tcp_mem = 375549 500734 751098 net.ipv4.tcp_min_snd_mss = 48 net.ipv4.tcp_min_tso_segs = 2 net.ipv4.tcp_moderate_rcvbuf = 1 net.ipv4.tcp_mtu_probing = 0 net.ipv4.tcp_no_metrics_save = 0 net.ipv4.tcp_notsent_lowat = -1 net.ipv4.tcp_orphan_retries = 0 net.ipv4.tcp_reordering = 3 net.ipv4.tcp_retrans_collapse = 1 net.ipv4.tcp_retries1 = 3 net.ipv4.tcp_retries2 = 15 net.ipv4.tcp_rfc1337 = 0 net.ipv4.tcp_rmem = 4096 87380 6291456 net.ipv4.tcp_sack = 1 net.ipv4.tcp_slow_start_after_idle = 1 net.ipv4.tcp_stdurg = 0 net.ipv4.tcp_syn_retries = 6 sysctl: net.ipv4.tcp_synack_retries = 5 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_thin_linear_timeouts = 0 net.ipv4.tcp_timestamps = 1 net.ipv4.tcp_tso_win_divisor = 3 net.ipv4.tcp_tw_recycle = 0 net.ipv4.tcp_tw_reuse = 0 net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_wmem = 4096 16384 4194304 net.ipv4.tcp_workaround_signed_windows = 0
 
 

Execute


echo "net.core.somaxconn = 8096 net.core.wmem_max = 8388608 net.core.rmem_max = 8388608 net.ipv4.tcp_fin_timeout = 5 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_mem = 8388608 12582912 16777216 net.ipv4.tcp_wmem = 8192 65536 8388608 net.ipv4.tcp_rmem = 8192 87380 8388608 net.ipv4.udp_mem = 8388608 12582912 16777216 ">> /etc/sysctl.conf
 
 
 
 
 

Recommendations