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. #==============================================================#
  10. [main]
  11. summary=Optimize for PostgreSQL TINY System
  12. # include=virtual-guest
  13. [vm]
  14. # disable transparent hugepages
  15. transparent_hugepages=never
  16. [sysctl]
  17. #-------------------------------------------------------------#
  18. # KERNEL #
  19. #-------------------------------------------------------------#
  20. # disable numa balancing
  21. kernel.numa_balancing=0
  22. # If a workload mostly uses anonymous memory and it hits this limit, the entire
  23. # working set is buffered for I/O, and any more write buffering would require
  24. # swapping, so it's time to throttle writes until I/O can catch up. Workloads
  25. # that mostly use file mappings may be able to use even higher values.
  26. #
  27. # The generator of dirty data starts writeback at this percentage (system default
  28. # is 20%)
  29. vm.dirty_ratio = 40
  30. # Filesystem I/O is usually much more efficient than swapping, so try to keep
  31. # swapping low. It's usually safe to go even lower than this on systems with
  32. # server-grade storage.
  33. vm.swappiness = 30
  34. #-------------------------------------------------------------#
  35. # Network #
  36. #-------------------------------------------------------------#
  37. # tcp options
  38. net.ipv4.tcp_timestamps=1
  39. net.ipv4.tcp_tw_reuse=1
  40. net.ipv4.tcp_tw_recycle=0
  41. net.ipv4.tcp_syncookies=0
  42. net.ipv4.tcp_synack_retries=1
  43. net.ipv4.tcp_syn_retries=1
  44. # tcp probe fail interval: 75s -> 20s
  45. net.ipv4.tcp_keepalive_intvl=20
  46. # tcp break after 3 * 20s = 1m
  47. net.ipv4.tcp_keepalive_probes=3
  48. # probe peroid = 1 min
  49. net.ipv4.tcp_keepalive_time=60

Last modified 2022-06-03: add scaffold for en docs (6a6eded)