29

Call to undefined method after upgrading to PHP 5.4.0 mentions a few APC bug-reports from March 2012.

My concrete question is: Is PHP 5.4.4 (or thereabouts) stable in combination with APC 3.1.10 (released in April, but listed as "beta" rather than "stable")?

We see 5 000 - 9 000 APC file cache hits/sec on our Apache boxes, as a vague indicator of traffic level. This is working fine with PHP 5.3.8 and APC 3.1.9 (using mod_php) -- does anyone have experience with comparable traffic on 5.4.4 and 3.1.10?

Community
  • 1
  • 1
Frank Farmer
  • 38,246
  • 12
  • 71
  • 89
  • Most of our non-dynamic resources are served by reverse proxies other than apache. Our biggest bottleneck on dynamic requests is PHP, rather than apache itself. Are there alternatives to APC+Apache we should consider? – Frank Farmer Jun 21 '12 at 22:17
  • @Frank Farmer: Apache mod_php or FCGI? And I'd say zerkms was gambling a bit. – hakre Jun 21 '12 at 22:17
  • @Frank Farmer: "Our biggest bottleneck on dynamic requests is PHP" --- how do you know that? Have you profiled your scripts? I doubt that different opcode cache implementations could give significant increase (comparing to each other). And I'm sure that the bottleneck is the code itself, not the opcode cache in front of it – zerkms Jun 21 '12 at 22:24
  • 2
    `And I'm sure that the bottleneck is the code itself` I agree. That's why I believe our use of Apache is largely irrelevant here. Perhaps I misunderstood your 4-word comment, however. What were you attempting to say with `Apache, high load... hmmmm`? – Frank Farmer Jun 21 '12 at 22:34
  • @Frank Farmer: just a sort of irony ;-), because on high loads apache often is not a solution due to much higher memory consumption – zerkms Jun 21 '12 at 23:14
  • 3
    I found the latest APC to be unstable even at extremely low loads on PHP 5.4 on php-fpm. I switched to xcache and had no problems. – Matthew Jun 28 '12 at 17:33
  • I think you've kind of answered your own question with "high traffic site" + "beta". APC 3.1.10 is **not** stable. I have a site that is pretty much single-user at the moment (still in development), and have had APC segfault on me a couple of times already (bugs are reported). I've tried both the 3.1.10 tag and the trunk, using nginx + php-fpm. – Leigh Jun 30 '12 at 07:00
  • I think what zerkms wanted to say that if you really have to stick with high load you should head for something more appropriate like Nginx or Mongrel2. And yeah... Besides other bottlenecks he's right;) – nico gawenda Jul 01 '12 at 01:51
  • 2
    I don't think this is programming related... – Alix Axel Jul 01 '12 at 23:51
  • @leigh We've had success running previous APC "beta" versions in production -- which is to say, sometimes they're stable enough. I appreciate the note re: segfaults in 3.1.10, however: that's exactly the kind of feedback I'm looking for. – Frank Farmer Jul 02 '12 at 18:02
  • 1
    @FrankFarmer http://news.php.net/php.internals/61084 Should be Soon(TM) – Leigh Jul 03 '12 at 15:03

2 Answers2

11

No. Tried it on a high-traffic site already. Segfaults badly on 3.1.10 about 75% of the time or more due to string corruption. The trunk version (as of 6/27/2012) is somewhat better but still too unstable for us for production.

See: https://bugs.php.net/bug.php?id=62442

mmucklo
  • 390
  • 2
  • 6
0

First : give APC lot of memory.

Check my answer there to know how to configure APC What is causing "Unable to allocate memory for pool" in PHP?

As you said, 5000 to 9000 hits/s is not very reliable information, it depends on what is running. Magento uses 10k files and generate lot of hits for one page view.

Best optimizations are on architecture level. Consider using reverse proxy and application cache for your website.

Community
  • 1
  • 1
bokan
  • 3,601
  • 2
  • 23
  • 38