-1

How do you do deployment PHP applications with enabled OpCache? My situation:

  • I have web server with PHP 7.4 and enabled OpCache.
  • Server is common virtual 4vCPU + 8GB RAM.
  • I use tool Deployer - finished with switch symlink.
  • Deployment is many times on day. Usually I deploy 5-10x times small changes.
  • Before deploy I have load 3-4.
  • After deploy I run opcache_reset (curl for http request) and load is >10. Response time is too high.

I understand how Opcache save caches to shared memory in PHP-FPM. But what is the correct solution for deployment without high-load and full availability?

grogsy
  • 99

1 Answers1

0

Thanks for the answer and link above.

Current solution is:

  • Do not call opcache_reset after deploy.
  • Set bigger value for option opcache.memory_consumption.
  • I do opcache_reset in night as cron job.

The reason for night cron job is high CPU usage while overflow cache and OpCache automaticaly call reset cache.

grogsy
  • 99