您的位置: 盘锦信息港 > 娱乐

服务器优化

发布时间:2019-06-19 15:23:47

  服务器的负载能力,很大程度上取决于系统管理员的配置和优化能力。相同的硬件、不同的软件配置,会造成截然不同的效果。下面我将给大家介绍一下如何优化 sysctrl, Apache 以及 MySQL 。请注意,所有配置均为取决于个人,请根据自己的实际情况做调整。

  配置Sysctl

  此文件:

  nano -w /etc/nf

  如果该文件为空,则输入以下内容,否则请根据情况自己做调整:

  # Controls source route verification

  # Default should work for all interfaces

  _filter = 1

  # _filter = 1

  # _filter = 1

  # _filter = 1

  # Disables IP source routing

  # Default should work for all interfaces

  cept_source_route = 0

  # cept_source_route = 0

  # cept_source_route = 0

  # cept_source_route = 0

  # Controls the System Request debugging functionality of the kernel

  srq = 0

  # Controls whether core dumps will append the PID to the core filename.

  # Useful for debugging multi-threaded applications.

  re_uses_pid = 1

  # Increase maximum amount of memory allocated to shm

  # Only uncomment if needed!

  # mmax =

  # Disable ICMP Redirect Acceptance

  # Default should work for all interfaces

  cept_redirects = 0

  # cept_redirects = 0

  # cept_redirects = 0

  # cept_redirects = 0

  # Enable Log Spoofed Packets, Source Routed Packets, Redirect Packets

  # Default should work for all interfaces

  g_martians = 1

  # g_martians = 1

  # g_martians = 1

  # g_martians = 1

  # Decrease the time default value for tcp_fin_timeout connection

  p_fin_timeout = 25

  # Decrease the time default value for tcp_keepalive_time connection

  p_keepalive_time = 1200

  # Turn on the tcp_window_scaling

  p_window_scaling = 1

  # Turn on the tcp_sack

  p_sack = 1

  # tcp_fack should be on because of sack

  p_fack = 1

  # Turn on the tcp_timestamps

  p_timestamps = 1

  # Enable TCP SYN Cookie Protection

  p_syncookies = 1

  # Enable ignoring broadcasts request

  mp_echo_ignore_broadcasts = 1

  # Enable bad error message Protection

  mp_ignore_bogus_error_responses = 1

  # Make more local ports available

  # _local_port_range = 1024 65000

  # Set TCP Re-Ordering value in kernel to ‘5′

  p_reordering = 5

  # Lower syn retry rates

  p_synack_retries = 2

  p_syn_retries = 3

  # Set Max SYN Backlog to ‘2048′

  p_max_syn_backlog = 2048

  # Various Settings

  dev_max_backlog = 1024

  # Increase the maximum number of skb-heads to be cached

  t_list_length = 256

  # Increase the tcp-time-wait buckets pool size

  p_max_tw_buckets = 360000

  # This will increase the amount of memory available for socket input/output queues

  em_default = 65535

  em_max =

  p_rmem = 4096 87380

  em_default = 65535

  em_max =

  p_wmem = 4096 65535

  p_mem =

  tmem_max = 40960

气滞血瘀型月经不调
千金益母颗粒多少钱
千金益母颗粒价格
猜你会喜欢的
猜你会喜欢的