1

On our current monolithic LAMP servers we deploy via Capistrano and reload PHP-FPM at the end of a deployment, in order to flush the Opcode Cache.

Now, we're building a new webhosting cluster on AWS for dozens of PHP 7.0 and PHP 5.5 applications. The application-servers with PHP-FPM will autoscale horizontally. PHP code will be stored on an NFS server and static assets on Amazon S3.

How do I flush all the OpCaches after a deploy when I don't have a fixed list of hosts?

Martijn Heemels
  • 7,438
  • 6
  • 39
  • 62
  • Consider EFS (elastic file system) instead of NFS. – Tim Nov 02 '16 at 22:43
  • @Tim That's actually what we're going to do. I didn't want to make this question more complicated by using three-letter-acronyms that some people may not know. – Martijn Heemels Nov 22 '16 at 08:28

1 Answers1

2

Storing code on NFS is not funny though. Anyway, you can use mcollective to send a message to all connected servers.

Yarik Dot
  • 1,543
  • 12
  • 26
  • We're using Amazon EFS, which appears to have better performance than standard NFS. So far our tests have shown no problems. – Martijn Heemels Nov 29 '16 at 14:49
  • MCollective is a good idea, since we're using Puppet anyway. Do you think a push-based system like MCollective will work better than a pull-based system (e.g. where all servers run a daemon that subscribes to a pub/sub queue which is triggered when caches must be flushed)? – Martijn Heemels Nov 29 '16 at 14:52