Jumat, 28 Maret 2014

optimalkan squid

Set default FD jadi 1024
cheek di console default FD yang ada berapa nilainya dengan perintah:
# ulimit -n
1024

cara merubah angka 1024 ke 65536 dengan perintah:
# ulimit -HSn 65536
# echo "root soft nofile 65536" >> /etc/security/limits.conf
# echo "root hard nofile 65536" >> /etc/security/limits.conf

Selanjutnya 1 Tambahkan script
session required pam_limits.so
pada
# nano /etc/pam.d/common-session

Selanjutnya 2 Lakukan perintah :
# modprobe ip_conntrack
Dan tambahkan script
ip_contrack
pada file /etc/modules dengan perintah :
# nano /etc/modules
Lalu sisipkan code dibawah ini didalamnya
ip_conntrack

Kemudian ubah /etc/sysctl.conf dengan code berikut dengan perintah
# nano /etc/sysctl.conf
ubah atau ganti dengan dengan :
------------------------------
# Start Conf
# sysclt.conf
# Locate /etc/sysctl.conf
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# max openfiles
fs.file-max = 65536
# Minimalis use swap disk
vm.drop_caches = 3
vm.swappiness = 3
# kernel.shmall = 2097152
# kernel.shmmax = 2147483648
# kernel.shmmni = 4096
# kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
net.ipv4.tcp_low_latency = 1
net.core.netdev_max_backlog = 4000
net.ipv4.tcp_max_syn_backlog = 16384
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_mem = 786432 1048576 1572864
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 65536 4194304
# net.ipv4.tcp_rmem = 4096 87380 8388608
# net.ipv4.tcp_wmem = 4096 65536 8388608
net.core.wmem_max = 8388608
net.core.rmem_max = 8388608
net.ipv4.tcp_tw_recycle = 1
# Controls IP packet forwarding
net.ipv4.ip_forward = 1
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
kernel.core_uses_pid = 1
# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1
# Controls the maximum size of a message, in bytes
kernel.msgmnb = 65536
# Controls the default maxmimum size of a mesage queue
kernel.msgmax = 65536
# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
# End Conf
-----------------------------------
Setelah itu check configurasi sysctl.conf lakukan dengan perintah:
# sysctl -p

Kemudian tambahkan entri berikut pada file /etc/security/limits.conf
# nano /etc/security/limits.conf (tambahakan script)
* - nofile 65536
root soft nofile 65536
root hard nofile 65536

Selesai & reboot

Tidak ada komentar:

Posting Komentar