TINY
Tuned TINY模板,针对微型实例与虚拟机
Tuned TINY模板主要针对极低配置的虚拟机进行优化,
此模板针对的典型机型是1核/1GB的虚拟机节点。您可以根据自己的实际机型进行调整。
1. # tuned configuration
2. #==============================================================#
3. # File : tuned.conf
4. # Mtime : 2020-06-29
5. # Desc : Tune operatiing system to tiny mode
6. # Path : /etc/tuned/tiny/tuned.conf
7. # Author : Vonng(fengruohang@outlook.com)
8. # Copyright (C) 2018-2021 Ruohang Feng
9. #==============================================================#
11. [main]
12. summary=Optimize for PostgreSQL TINY System
13. # include=virtual-guest
15. [vm]
16. # disable transparent hugepages
17. transparent_hugepages=never
19. [sysctl]
20. #-------------------------------------------------------------#
21. # KERNEL #
22. #-------------------------------------------------------------#
23. # disable numa balancing
24. kernel.numa_balancing=0
26. # If a workload mostly uses anonymous memory and it hits this limit, the entire
27. # working set is buffered for I/O, and any more write buffering would require
28. # swapping, so it's time to throttle writes until I/O can catch up. Workloads
29. # that mostly use file mappings may be able to use even higher values.
30. #
31. # The generator of dirty data starts writeback at this percentage (system default
32. # is 20%)
33. vm.dirty_ratio = 40
35. # Filesystem I/O is usually much more efficient than swapping, so try to keep
36. # swapping low. It's usually safe to go even lower than this on systems with
37. # server-grade storage.
38. vm.swappiness = 30
40. #-------------------------------------------------------------#
41. # Network #
42. #-------------------------------------------------------------#
43. # tcp options
44. net.ipv4.tcp_timestamps=1
45. net.ipv4.tcp_tw_reuse=1
46. net.ipv4.tcp_tw_recycle=0
47. net.ipv4.tcp_syncookies=0
48. net.ipv4.tcp_synack_retries=1
49. net.ipv4.tcp_syn_retries=1
51. # tcp probe fail interval: 75s -> 20s
52. net.ipv4.tcp_keepalive_intvl=20
53. # tcp break after 3 * 20s = 1m
54. net.ipv4.tcp_keepalive_probes=3
55. # probe peroid = 1 min
56. net.ipv4.tcp_keepalive_time=60
Last modified 2022-06-03: add scaffold for en docs (6a6eded)
