https://developer.aliyun.com/article/536805
https://help.aliyun.com/zh/ecs/support/common-kernel-network-parameters-of-ecs-linux-instances-and-faq
- hosts: all gather_facts: no become: yes tasks: #- name: Insert content below a specific line # lineinfile: # path: /usr/local/nginx/conf/nginx.conf # insertafter: '\s+access_log logs/access.log combinedio;' # line: | # client_max_body_size 20m; #- name: replace IP address of all hosts to all hosts # replace: # dest: /usr/local/nginx/conf/nginx.conf # regexp: '\s+client_body_timeout 10;client_max_body_size 30m;' # replace: "client_body_timeout 10;\nclient_body_buffer_size 1024M;\nclient_max_body_size 30m;\n" - name: Set sysctl tags: - sysctl sysctl: > name="{{item.name}}" state=absent changed_when: true failed_when: false ignore_errors: yes with_items: - { name: 'net.bridge.bridge-nf-call-iptable'} - { name: 'net.bridge.bridge-nf-call-arptables'} - { name: 'net.bridge.bridge-nf-call-ip6tables'} - { name: 'net.bridge.bridge-nf-call-iptables'} - name: Set sysctl tags: - sysctl sysctl: > name="{{item.name}}" value="{{item.value}}" state=present sysctl_set=yes ignore_errors: yes with_items: - { name: 'fs.nr_open', value: '100000000'} - { name: 'fs.file-max', value: '100000000'} - { name: 'net.core.somaxconn', value: '262144'} - { name: 'net.ipv4.tcp_max_syn_backlog', value: '262144'} - { name: 'net.core.netdev_max_backlog', value: '262144'} - { name: 'net.ipv4.tcp_max_orphans', value: '262144'} - { name: 'net.ipv4.tcp_max_tw_buckets', value: '12000'} - { name: 'net.ipv4.tcp_tw_recycle', value: '0'} - { name: 'net.ipv4.tcp_tw_reuse', value: '1'} - { name: 'net.ipv4.tcp_syncookies', value: '1'} - { name: 'net.ipv4.tcp_timestamps', value: '1'} - { name: 'net.ipv4.tcp_fin_timeout', value: '5'} - { name: 'net.ipv4.tcp_keepalive_time', value: '30'}
#online worker_processes 24; #include servers.conf; events { worker_connections 10000; multi_accept on; use epoll; }
标签:value,name,max,配置,tcp,内核,net,ipv4 From: https://www.cnblogs.com/tiantao36/p/18310507