I’ve been tweaking and playing with Linux web hosting for about 5 years. Last year, I finally took the plunge and went to Amazon AWS.
It’s a bit nerve racking, since the learning curve is so high. It’s all worth it when you see stats like this, and anyone familiar with configuring APC + PHP + W3 Total Cache will appreciate this graph:
(hint: there’s almost no fragmentation)
Update: Some of you have asked to see my setup and PHP configuration.
Amazon Large Instance
- Operating system – Ubuntu Linux 11.10
- Kernel - Linux 3.0.0-14-virtual on x86_64
- Processor - Intel(R) Xeon(R) CPU E5507 @ 2.27GHz, 2 cores
- RAM - 7.29 GB total
- Disk - 1.80 TB total
- Apache - 2.2.20
- PHP - 5.3.6
- APC – 3.1.9
My php.ini configuration
[APC] extension=apc.so apc.enabled = 1 apc.shm_segments = 1 apc.shm_size = 512M apc.optimization = 0 apc.num_files_hint = 4096 apc.ttl = 0 apc.user_ttl = 0 apc.gc_ttl = 900 apc.cache_by_default = 1 apc.filters = "apc\.php$" apc.mmap_file_mask = "/tmp/apc.XXXXXX" apc.slam_defense = 0 apc.file_update_protection = 2 apc.enable_cli = 0 apc.max_file_size = 10M apc.stat = 1 apc.write_lock = 1 apc.report_autofilter = 0 apc.include_once_override = 0 apc.localcache = 0 apc.localcache.size = 512M apc.coredump_unmap = 0 apc.stat_ctime = 0 apc.use_request_time = 1 apc.canonicalize = 1 apc.lazy_functions = 0 apc.lazy_classes = 1
While this configuration works great for me, keep in mind, that my apc.shm_size is set to 512M because my server has almost 8GB of RAM.












It’s worth pointing out that there’s no such thing as the perfect config… Unless your site is virtually identical to this one :)
I work with wp sites every day and it’s safe to safe that one size does not fit all. These setting might kill someone else’s server or might not be enough
It’s something that should be tested, monitored and tweaked for your own sites
Your right about avoiding fragmentation though – it kills performance if apc gets too fragmented
I should’ve been more specific in the title huh? “The Perfect APC Configuration… FOR ME” :)