{"id":25031,"date":"2015-12-11T10:01:34","date_gmt":"2015-12-11T08:01:34","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=25031"},"modified":"2015-12-11T10:01:34","modified_gmt":"2015-12-11T08:01:34","slug":"apc-is-dead-long-live-opcache","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2015\/12\/11\/apc-is-dead-long-live-opcache\/","title":{"rendered":"APC is dead, long live OPcache"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>Since this is probably common knowledge by now, this blog post is more a note to my future self. \u00a0<a href=\"http:\/\/php.net\/manual\/en\/book.apc.php\">APC<\/a> is dead. \u00a0Don&#8217;t use it. \u00a0Use <a href=\"http:\/\/php.net\/manual\/en\/book.opcache.php\">OPcache<\/a> instead. \u00a0<a href=\"https:\/\/pecl.php.net\/package\/APCu\">APCu<\/a> is something else.<\/p>\n<p>In the last few years I&#8217;ve had so much issues with APC, that I eventually stopped installing it on my servers by default. \u00a0Now that I need to squeeze every bit of performance for one of the projects, I looked back at it. \u00a0And tried it. \u00a0And once again it kicked me in the balls. \u00a0Then I remembered that I&#8217;ve seen APCu somewhere. \u00a0Maybe it&#8217;s a newer fork or something.<\/p>\n<p>Gladly, after a quick Google search for the difference, I came across <a href=\"http:\/\/wordpress.stackexchange.com\/questions\/174317\/apc-vs-apcu-vs-opcache\">this discussion<\/a>, which clarified a few things.<\/p>\n<blockquote><p>So out of those you named:<\/p>\n<ul>\n<li>APC is opcode cache <em>and<\/em> data store<\/li>\n<li>APCu is <em>only<\/em> data store<\/li>\n<li>OPcache is <em>only<\/em> opcode cache<\/li>\n<\/ul>\n<p>Since APC is older, at the moment you likely want OPcache as well as some data store, not necessarily APCu (although it is perfectly fine choice).<\/p><\/blockquote>\n<p>My interest was in opcode cache, since I already had a data store. \u00a0Installing and configuring OPcache needed just a few seconds, and didn&#8217;t cause any issues so far.<\/p>\n<p>And if you want more information about it, here is a <a href=\"http:\/\/www.sitepoint.com\/understanding-opcache\/\">useful article<\/a>, which, among other things, lists the helpful tools for monitoring and tweaking OPcache configuration.<\/p>\n<blockquote>\n<h3 id=\"3-how-to-check-if-opcache-is-actually-caching-my-files\">3. How to check if OpCache is actually caching my files?<\/h3>\n<p>If you have already installed and configured OpCache, you may find it important to control which PHP files are actually being cached. The whole cache engine works in the background and is transparent to a visitor or a web developer. In order to check its status, you may use one of the two functions that provide such information: <a href=\"http:\/\/www.php.net\/manual\/en\/function.opcache-get-configuration.php\">opcache_get_configuration()<\/a> and <a href=\"http:\/\/www.php.net\/manual\/en\/function.opcache-get-status.php\">opcache_get_status()<\/a>. Fortunately, there is a couple of prepared scrips that fetch all the OpCache configuration and status data and display it in a friendly way. You don\u2019t need to write any code by yourself, just pick up one of tools from these below:<br \/>\n\u2013 <a href=\"https:\/\/gist.github.com\/ck-on\/4959032\/?ocp.php\">Opcache Control Panel<\/a>,<br \/>\n\u2013 <a href=\"https:\/\/github.com\/rlerdorf\/opcache-status\">opcache-status<\/a> by Rasmus Lerdorf,<br \/>\n\u2013 <a href=\"https:\/\/github.com\/PeeHaa\/OpCacheGUI\">OpCacheGUI<\/a> by Pieter Hordijk,<br \/>\n\u2013 <a href=\"https:\/\/github.com\/amnuts\/opcache-gui\">opcache-gui<\/a> by Andrew Collington.<\/p><\/blockquote>\n<p>May the Cache be with you.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>Since this is probably common knowledge by now, this blog post is more a note to my future self. \u00a0APC is dead. \u00a0Don&#8217;t use it. \u00a0Use OPcache instead. \u00a0APCu is something else. In the last few years I&#8217;ve had so much issues with APC, that I eventually stopped installing it on my servers by default. &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2015\/12\/11\/apc-is-dead-long-live-opcache\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">APC is dead, long live OPcache<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"APC is dead, long live OPcache #PHP #WebDev #performance","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,18,62,1334],"tags":[1057,38,1330],"keyring_services":[],"class_list":["post-25031","post","type-post","status-publish","format-standard","hentry","category-general","category-programming","category-technology","category-web-work","tag-performance","tag-php","tag-web-development"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":28119,"url":"https:\/\/mamchenkov.net\/wordpress\/2017\/10\/18\/phpfastcache-high-performance-distributed-object-caching-system\/","url_meta":{"origin":25031,"position":0},"title":"phpFastCache &#8211; high-performance, distributed object caching system","author":"Leonid Mamchenkov","date":"October 18, 2017","format":false,"excerpt":"phpFastCache is a high-performance, distributed object caching system for PHP.\u00a0 It supports a variety of drivers, as per its GitHub repository: APC(u) Cookie Files Memcache(d) Redis ... and many more.","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":16668,"url":"https:\/\/mamchenkov.net\/wordpress\/2012\/09\/04\/solution-to-wordpress-with-wp-super-cache-blank-pages-problem\/","url_meta":{"origin":25031,"position":1},"title":"Solution to WordPress with WP Super Cache blank pages problem","author":"Leonid Mamchenkov","date":"September 4, 2012","format":false,"excerpt":"This took me a while to figure out, so I'll post it here in case someone else ever gets into this problem. \u00a0After enabling WP Super Cache for a project at work, we've started seeing really weird and really random white page issues. \u00a0WordPress would show a blank page and\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11936,"url":"https:\/\/mamchenkov.net\/wordpress\/2009\/11\/19\/day-in-brief\/","url_meta":{"origin":25031,"position":2},"title":"Day in brief","author":"Leonid Mamchenkov","date":"November 19, 2009","format":false,"excerpt":"Woke up with no hangover what so ever. That is very suspicious. Upgraded to Fedora 12. Now for breakfast and more talks. #ipc09 # Stress-free deployment talk for me to kick off the last day of #ipc09 # Automatic deployment of database scheme changes. Tools: dbdeploy, LiquiBase, Doctrine. #ipc09 #\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":24803,"url":"https:\/\/mamchenkov.net\/wordpress\/2015\/10\/03\/sql-vs-nosql-how-to-choose\/","url_meta":{"origin":25031,"position":3},"title":"SQL vs NoSQL: How to Choose","author":"Leonid Mamchenkov","date":"October 3, 2015","format":false,"excerpt":"\"SQL vs NoSQL: How to Choose\" article continues the discussion of SQL vs. NoSQL from the \"SQL vs NoSQL: The Differences\" article. \u00a0Both should be read in full. \u00a0But I'll keep the summary here for future use. SQL databases: store related data in tables require a schema which defines tables\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":29020,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/11\/24\/graphit-high-performance-graph-domain-specific-language\/","url_meta":{"origin":25031,"position":4},"title":"GraphIt &#8211; high-performance graph domain specific language","author":"Leonid Mamchenkov","date":"November 24, 2018","format":false,"excerpt":"GraphIt is a\u00a0high-performance graph domain specific language.\u00a0 If you are involved with graph data structures (web, social networks, maps, and so on and so forth), check it out.\u00a0 It's sounds pretty cool.\u00a0 Here's a 20 minute video of a talk that does an overview of the language and some examples.\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/img.youtube.com\/vi\/ptIVf-YlkhY\/0.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":24398,"url":"https:\/\/mamchenkov.net\/wordpress\/2015\/06\/23\/php7-reference\/","url_meta":{"origin":25031,"position":5},"title":"PHP7 Reference","author":"Leonid Mamchenkov","date":"June 23, 2015","format":"link","excerpt":"PHP7 Reference -\u00a0An overview of the features, changes, and backward compatibility breakages in PHP 7 Unarguably the greatest part about PHP 7 is the incredible performance boosts it provides to applications. This is a result of refactoring the Zend Engine to use more compact data structures and less heap allocations\/deallocations.\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/25031","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=25031"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/25031\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=25031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=25031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=25031"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=25031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}