{"action":"created","issue":{"url":"https://api.github.com/repos/zyqf/DNS/issues/31","repository_url":"https://api.github.com/repos/zyqf/DNS","labels_url":"https://api.github.com/repos/zyqf/DNS/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/zyqf/DNS/issues/31/comments","events_url":"https://api.github.com/repos/zyqf/DNS/issues/31/events","html_url":"https://github.com/zyqf/DNS/issues/31","id":154157716,"number":31,"title":"优化linux内核，提高bind9性能","user":{"login":"zyqf","id":8760518,"avatar_url":"https://avatars.githubusercontent.com/u/8760518?v=3","gravatar_id":"","url":"https://api.github.com/users/zyqf","html_url":"https://github.com/zyqf","followers_url":"https://api.github.com/users/zyqf/followers","following_url":"https://api.github.com/users/zyqf/following{/other_user}","gists_url":"https://api.github.com/users/zyqf/gists{/gist_id}","starred_url":"https://api.github.com/users/zyqf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyqf/subscriptions","organizations_url":"https://api.github.com/users/zyqf/orgs","repos_url":"https://api.github.com/users/zyqf/repos","events_url":"https://api.github.com/users/zyqf/events{/privacy}","received_events_url":"https://api.github.com/users/zyqf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zyqf/DNS/labels/%E5%BB%BA%E8%AE%AE","name":"建议","color":"cccccc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-11T04:28:09Z","updated_at":"2016-05-16T03:47:29Z","closed_at":null,"body":"查看TIME_WAIT\r\n\r\n`netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'`\r\n\r\n数值如果高于50，建议调优。\r\n\r\nvim /etc/sysctl.conf\r\n```\r\nnet.ipv4.tcp_syncookies = 1\r\nnet.ipv4.tcp_max_syn_backlog = 1024\r\nnet.ipv4.tcp_synack_retries = 2\r\nnet.ipv4.conf.lo.arp_announce = 2\r\nnet.ipv4.tcp_tw_reuse = 1\r\nnet.ipv4.tcp_tw_recycle = 1\r\nnet.ipv4.tcp_fin_timeout = 30\r\nnet.ipv4.tcp_keepalive_time = 1200\r\nnet.ipv4.tcp_max_syn_backlog = 8192\r\nnet.ipv4.tcp_max_tw_buckets = 6000\r\nnet.ipv4.tcp_max_syn_backlog = 65536\r\nnet.core.netdev_max_backlog = 32768\r\nnet.core.rmem_max = 16777216\r\nnet.core.wmem_max = 16777216\r\n```\r\n保存并生效配置\r\n\r\n`sysctl -p`\r\n\r\n需要等待几分钟，TIME_WAIT数值才会降下来。"},"comment":{"url":"https://api.github.com/repos/zyqf/DNS/issues/comments/219342944","html_url":"https://github.com/zyqf/DNS/issues/31#issuecomment-219342944","issue_url":"https://api.github.com/repos/zyqf/DNS/issues/31","id":219342944,"user":{"login":"zyqf","id":8760518,"avatar_url":"https://avatars.githubusercontent.com/u/8760518?v=3","gravatar_id":"","url":"https://api.github.com/users/zyqf","html_url":"https://github.com/zyqf","followers_url":"https://api.github.com/users/zyqf/followers","following_url":"https://api.github.com/users/zyqf/following{/other_user}","gists_url":"https://api.github.com/users/zyqf/gists{/gist_id}","starred_url":"https://api.github.com/users/zyqf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyqf/subscriptions","organizations_url":"https://api.github.com/users/zyqf/orgs","repos_url":"https://api.github.com/users/zyqf/repos","events_url":"https://api.github.com/users/zyqf/events{/privacy}","received_events_url":"https://api.github.com/users/zyqf/received_events","type":"User","site_admin":false},"created_at":"2016-05-16T03:47:28Z","updated_at":"2016-05-16T03:47:28Z","body":"感谢提出，已解决"}}