Skip to content

Instantly share code, notes, and snippets.

@denihida1216
Created December 11, 2023 06:22
Show Gist options
  • Save denihida1216/5366a793c3cfe91c4fbb8714dadd6ba2 to your computer and use it in GitHub Desktop.
Save denihida1216/5366a793c3cfe91c4fbb8714dadd6ba2 to your computer and use it in GitHub Desktop.
Tuning Cache Connection Best Performance
PHP-FPM Configuration (php-fpm.conf or www.conf):
location /etc/php/7.4/fpm/pool.d/www.conf
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.process_idle_timeout = 10s
pm.max_requests = 500
Opcache:
Enable and configure OPcache to cache compiled PHP code.
location /etc/php/7.4/fpm
opcache.enable = 1
opcache.memory_consumption = 128
opcache.max_accelerated_files = 4000
opcache.revalidate_freq = 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment