{"id":1035,"date":"2019-01-04T16:37:46","date_gmt":"2019-01-04T09:37:46","guid":{"rendered":"https:\/\/www.whplus.com\/blog\/?p=1035"},"modified":"2019-01-21T06:34:38","modified_gmt":"2019-01-20T23:34:38","slug":"tuning-sysctl-conf-on-centos-7","status":"publish","type":"post","link":"https:\/\/www.whplus.com\/blog\/2019\/01\/04\/tuning-sysctl-conf-on-centos-7.html","title":{"rendered":"Tuning sysctl.conf on CentOS 7"},"content":{"rendered":"\n<p><code>Sysctl<\/code>\u00a0lets the user fine tune the kernel without having to rebuild the kernel. It also will apply the changes immediately, thus the server won&#8217;t have to be rebooted for changes to take effect. To make the changes permanent, you will have to add these values to a configuration file. Use the configuration file CentOS provides by default,\u00a0<code>\/etc\/sysctl.conf<\/code>.<\/p>\n\n\n\n<p>Open the file with your favorite editor.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># sysctl settings are defined through files in\n# \/usr\/lib\/sysctl.d\/, \/run\/sysctl.d\/, and \/etc\/sysctl.d\/.\n#\n# Vendors settings live in \/usr\/lib\/sysctl.d\/.\n# To override a whole file, create a new file with the same in\n# \/etc\/sysctl.d\/ and put new settings there. To override\n# only specific settings, add a file with a lexically later\n# name in \/etc\/sysctl.d\/ and put new settings there.\n#\n# For more information, see sysctl.conf(5) and sysctl.d(5).\n\n# Minimizing the amount of swapping\nvm.swappiness = 20\nvm.dirty_ratio = 80\nvm.dirty_background_ratio = 5\n\n# Increases the size of file handles and inode cache &amp; restricts core dumps\nfs.file-max = 2097152\nfs.suid_dumpable = 0\n\n# Change the amount of incoming connections and incoming connections backlog\nnet.core.somaxconn = 65535\nnet.core.netdev_max_backlog = 262144\n\n# Increase the maximum amount of memory buffers\nnet.core.optmem_max = 25165824\n\n# Increase the default and maximum send\/receive buffers\nnet.core.rmem_default = 31457280\nnet.core.rmem_max = 67108864\nnet.core.wmem_default = 31457280\nnet.core.wmen_max = 67108864\n\n# Enable TCP SYN cookie protection\nnet.ipv4.tcp_syncookies = 1\n\n# Enable IP spoofing protection\nnet.ipv4.conf.all.rp_filter = 1\n\n# Enable ignoring to ICMP requests and broadcasts request\nnet.ipv4.icmp_echo_ignore_all = 1\nnet.ipv4.icmp_echo_ignore_broadcasts = 1\n\n# Enable logging of spoofed packets, source routed packets and redirect packets\nnet.ipv4.conf.all.log_martians = 1\n\n# Disable IP source routing\nnet.ipv4.conf.all.accept_source_route = 0\n\n# Disable ICMP redirect acceptance\nnet.ipv4.conf.all.accept_redirects = 0<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Sysctl\u00a0lets the user fine tune the kernel without having to rebuild the kernel. It also will apply the changes immediately, thus the server won&#8217;t have to be rebooted for changes to take effect. To make the changes permanent, you will have to add these values to a configuration file. Use the configuration file CentOS provides\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.whplus.com\/blog\/2019\/01\/04\/tuning-sysctl-conf-on-centos-7.html\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[45],"tags":[],"class_list":["post-1035","post","type-post","status-publish","format-standard","hentry","category-referensi"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/posts\/1035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/comments?post=1035"}],"version-history":[{"count":2,"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/posts\/1035\/revisions"}],"predecessor-version":[{"id":1042,"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/posts\/1035\/revisions\/1042"}],"wp:attachment":[{"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/media?parent=1035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/categories?post=1035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.whplus.com\/blog\/wp-json\/wp\/v2\/tags?post=1035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}