harmony-one / experiment-deploy

Repo for conducting benchmark experiments
20 stars 15 forks source link

[ansible]optimize kernel tuning on deploy #352

Closed jhd2best closed 4 years ago

jhd2best commented 4 years ago

to resolve the issue https://github.com/harmony-one/harmony-ops/issues/585. update kernel tuning by modify /etc/sysctl.conf instead of exec sysctl -w to avoid machine restart loss the config.

jhd2best commented 4 years ago

Test Result: PASS

Test Log: $ ansible-playbook -i inventory/azure.hosts playbooks/sysctl-setup.yml -e 'inventory=test user=hmy'

PLAY [test] **

TASK [Gathering Facts] *** ok: [52.*.*.139]

TASK [gather OS specific variables] ** ok: [52.*.*.139] => (item=experiment-deploy/ansible/playbooks/vars/Azure-CentOS.yml)

TASK [kernel tuning] ***** ok: [52.*.*.139] => (item={'name': 'fs.file-max', 'value': '2097152'}) ok: [52.*.*.139] => (item={'name': 'vm.swappiness', 'value': '10'}) ok: [52.*.*.139] => (item={'name': 'vm.dirty_ratio', 'value': '60'}) ok: [52.*.*.139] => (item={'name': 'vm.dirty_background_ratio', 'value': '2'}) ok: [52.*.*.139] => (item={'name': 'kernel.sched_migration_cost_ns', 'value': '5000000'})

TASK [general network security options] ** ok: [52.*.*.139] => (item={'name': 'net.ipv4.tcp_synack_retries', 'value': '2'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.ip_local_port_range', 'value': '2000 65535'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.tcp_rfc1337', 'value': '1'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.tcp_syncookies', 'value': '1'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.tcp_fin_timeout', 'value': '15'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.tcp_keepalive_time', 'value': '300'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.tcp_keepalive_probes', 'value': '5'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.tcp_keepalive_intvl', 'value': '15'})

TASK [tuning network performance] **** ok: [52.*.*.139] => (item={'name': 'net.core.rmem_default', 'value': '31457280'}) ok: [52.*.*.139] => (item={'name': 'net.core.rmem_max', 'value': '33554432'}) ok: [52.*.*.139] => (item={'name': 'net.core.wmem_default', 'value': '31457280'}) ok: [52.*.*.139] => (item={'name': 'net.core.wmem_max', 'value': '33554432'}) ok: [52.*.*.139] => (item={'name': 'net.core.somaxconn', 'value': '8096'}) ok: [52.*.*.139] => (item={'name': 'net.core.netdev_max_backlog', 'value': '65536'}) ok: [52.*.*.139] => (item={'name': 'net.core.optmem_max', 'value': '25165824'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.tcp_max_syn_backlog', 'value': '8192'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.tcp_mem', 'value': '786432 1048576 26777216'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.udp_mem', 'value': '65536 131072 262144'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.tcp_rmem', 'value': '8192 87380 33554432'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.udp_rmem_min', 'value': '16384'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.tcp_wmem', 'value': '8192 65536 33554432'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.udp_wmem_min', 'value': '16384'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.tcp_max_tw_buckets', 'value': '1440000'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.tcp_tw_reuse', 'value': '1'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.tcp_fastopen', 'value': '3'}) ok: [52.*.*.139] => (item={'name': 'net.ipv4.tcp_window_scaling', 'value': '1'})

TASK [active the configuration in sysctl.conf] *** changed: [52.*.*.139]

TASK [add env to limits.conf] **** changed: [52.*.*.139] => (item= soft nproc 65535) changed: [52.*.*.139] => (item= hard nproc 65535) changed: [52.*.*.139] => (item= soft nofile 65535) changed: [52.*.*.139] => (item= hard nofile 65535) changed: [52.*.*.139] => (item=root soft nproc 65535) changed: [52.*.*.139] => (item=root hard nproc 65535) changed: [52.*.*.139] => (item=root soft nofile 65535) changed: [52.*.*.139] => (item=root hard nofile 65535)

TASK [add env to common-session] ***** changed: [52.*.*.139]

PLAY RECAP *** 52.*.*.139 : ok=8 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0