0

I've got a moderately powerful VPS (quad core Xeon, 3GB ram, ssd) running Ubuntu 12.10, PHP 5.5.8 and Opcode cache is enabled.

I'm using memcached, opcode cache and mod_pageSpeed.

I'm monitoring the app using New Relic.

The issue is that no matter what I've tried, increasing memory limits, cache sizes, etc, I cannot get the request response time below about 80 ms.

The database is running Percona and that is spending about 40ms per request, and PHP is spending about 40ms per request.

All requests are being served up from OpCode compiled cache, so I don't understand where all the latency is coming from.

What am I missing?

Thanks. Apologies in advance if I've missed some crucial info, all can be supplied on request.

i-CONICA
  • 630
  • 1
  • 9
  • 22

1 Answers1

2

The opcode cache doesn't "compile, execute and cache the result". On the first request, your PHP code is compiled to bytecode, that bytecode is saved, and then it is executed. On subsequent requests, the saved bytecode is executed. Without an opcode cache, the PHP code would be compiled to bytecode during each request.

If you want to cache the output generated by your program and serve it rather than executing your program on each request, you need to look into additional caching techniques.

sciurus
  • 12,493
  • 2
  • 30
  • 49