What is the best way to load PHP classes in EC2 in the following scenario (#s are for illustrative purposes)? -> 100 EC2 instances running apache and APC -> 100 php classes loaded per request (via __autoload) -> 100 code changes per day between the classes (many of the classes contain auto-generated code that are periodically updated via cron).
From what I gather, there are 3 ways to load the php class files in EC2:
A. InstanceStore - The local (virtual) hard drive of an EC2 instance
-> Code must be pushed separately to each instance.
-> Fastest loading since no need to go over the network
B. EBS - A volume mounted to a particular instance
-> Code must be pushed separately to each instance.
-> Slower loading since go over the network
C. S3 - A S3 bucket can be 'mounted' to 1 or more EC2 instances
-> Code only needs to be pushed once
-> Slowest loading since go over the network
Even with APC enabled on the apache instances, I am not able to disable fstat in APC due to being unsure of how to handle the invalidation of the cached classes on all 100 apache instances 100+ times a day (when code changes). As a result, if each class load will generate a call to the filesystem even if the class was cached by apc (to do the fstat call), wouldn't there be huge latency if there were 100 round trips over the network to do fstat or read the file on every request?
What is the best option (or maybe a new way that is not list here) to load class files in the scenario described?