{"id":11600,"date":"2025-08-12T14:45:37","date_gmt":"2025-08-12T14:45:37","guid":{"rendered":"https:\/\/boostedhost.com\/blog\/opcache-settings-for-wordpress-2025-safe-values-that-actually-speed-things-up\/"},"modified":"2025-08-12T14:45:41","modified_gmt":"2025-08-12T14:45:41","slug":"opcache-settings-for-wordpress-2025-safe-values-that-actually-speed-things-up","status":"publish","type":"post","link":"https:\/\/boostedhost.com\/blog\/en\/opcache-settings-for-wordpress-2025-safe-values-that-actually-speed-things-up\/","title":{"rendered":"OPcache Settings for WordPress (2025): Safe Values that Actually Speed Things Up"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"11600\" class=\"elementor elementor-11600\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b91 e-con-full e-flex wpr-particle-no wpr-jarallax-no wpr-parallax-no wpr-sticky-section-no e-con e-parent\" data-id=\"b45a3b91\" data-element_type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b1 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b1\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><strong>Fact:<\/strong> a well-tuned PHP bytecode cache can cut CPU use by half and shave seconds off peak page load times for busy sites.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b2 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b2\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><em>If you care about fast pages and lower server bills, this matters.<\/em><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b3 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b3\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >OpCache stores compiled php code in shared memory so scripts skip parse and compile steps on each request. That reduces CPU spikes, improves scalability, and makes your visitor experience feel snappier.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b4 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b4\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >You\u2019ll get practical, production-safe defaults plus ranges to match small blogs or large builds. I\u2019ll show how to verify the cache is enabled, where common safe values start, and how to monitor hit rate, memory use, and restart reasons so you tune by real metrics\u2014not guesswork.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b5 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b5\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b6 elementor-widget elementor-widget-heading\" data-id=\"b45a3b6\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Key Takeaways<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b7 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b7\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul > <li>OpCache speeds PHP by serving compiled bytecode from memory.<\/li> <li>Verify it with a quick phpinfo check and look for the cache section.<\/li> <li>Start with conservative memory and file limits, then scale to fit your codebase.<\/li> <li>Watch hit rate, cache fullness, and restart reasons to tune safely.<\/li> <li>Use simple dashboards or plugins to track trends over time.<\/li> <\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b8 elementor-widget elementor-widget-heading\" data-id=\"b45a3b8\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Why OPcache matters for WordPress performance in 2025<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b9 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b9\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><em>When PHP bytecode stays in memory, each page view runs faster and uses less CPU.<\/em> That basic change lowers disk I\/O and trims compile time on every request. For your site, this often means quicker page loads, steadier server response, and better website performance during traffic spikes.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b10 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b10\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><strong>Lower server load<\/strong> gives your host room to handle more concurrent requests. That matters when a new post or promotion drives bursts of visits. Managed hosts usually include this cache, but you should confirm it is active and tuned to your plugins and theme footprint.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b11 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b11\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul >   <li>Many page views run multiple PHP files; keeping compiled code hot avoids repeat work and delivers snappier pages.<\/li>   <li>Faster pages improve user experience and help SEO because search engines favor sites that maintain speed as features grow.<\/li>   <li>For WooCommerce or membership sites where hits bypass full-page caches, the gains in php performance are especially clear.<\/li> <\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b12 elementor-widget elementor-widget-heading\" data-id=\"b45a3b12\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">What OPcache does for PHP and your WordPress site<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b13 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b13\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><em>A warmed bytecode cache lets PHP run compiled files instantly instead of redoing work on every request.<\/em> That cut in work shortens response times and keeps slow tails rare when traffic spikes.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b14 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b14\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><div class=\"ast-oembed-container \" style=\"height: 100%;\"><iframe title=\"How to use OPCache - ploi.io\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/5gp-ap7RpRI?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b15 elementor-widget elementor-widget-heading\" data-id=\"b45a3b15\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Faster execution by caching compiled PHP scripts<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b16 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b16\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><strong>Cached bytecode runs immediately.<\/strong> Rather than parsing source files on each hit, the engine executes precompiled units. This speeds up scripts and reduces the extra cycles spent rebuilding php code.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b17 elementor-widget elementor-widget-heading\" data-id=\"b45a3b17\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Lower CPU and server load during traffic spikes<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b18 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b18\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >Because compiled files live in shared memory, your server spends less time per request. That drop in server load prevents backlogs and keeps response times stable during bursts.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b19 elementor-widget elementor-widget-heading\" data-id=\"b45a3b19\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Better user experience and SEO from quicker page load times<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b20 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b20\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >Themes, builders, and plugins add many php scripts to each request. Keeping those compiled copies hot cuts redundant work, lowers disk I\/O, and yields faster page delivery.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b21 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b21\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul > <li>OpCache caches compiled php scripts in memory, avoiding repeated parse\/compile cycles.<\/li> <li>High hit rates mean fewer re-compilations and steadier times under load.<\/li> <li>Smaller CPU usage improves SEO signals by making pages reliably faster for visitors.<\/li> <\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b22 elementor-widget elementor-widget-heading\" data-id=\"b45a3b22\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">How to enable OPcache on your hosting stack<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b23 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b23\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><em>The quickest way to confirm caching is active is to load a tiny phpinfo page from your site root.<\/em> Create a file named phpinfo.php containing &lt;?php phpinfo(); ?&gt; and open it in a browser. Look for the &#8220;OpCache&#8221; section to see current values and status.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b24 elementor-widget elementor-widget-heading\" data-id=\"b45a3b24\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Check if OPcache is enabled via phpinfo and status<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b25 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b25\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >Create phpinfo.php, refresh, and scan the report for the cache section. If you need metrics in code, drop a small script that calls <code>opcache_get_status()<\/code> to read used memory, cached scripts, and restart timestamps.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b26 elementor-widget elementor-widget-heading\" data-id=\"b45a3b26\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Enable OPcache in php.ini or pool configs (Apache, Nginx with PHP-FPM)<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b27 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b27\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >If the cache is missing, edit the PHP configuration file on your server. Typical paths are \/etc\/php\/7.x\/apache2\/php.ini or \/etc\/php\/7.x\/fpm\/php.ini. Add or adjust lines such as <strong>opcache.enable=1<\/strong>, <strong>opcache.memory_consumption=128<\/strong>, <strong>opcache.interned_strings_buffer=8<\/strong>, <strong>opcache.max_accelerated_files=10000<\/strong>, and <strong>opcache.revalidate_freq=60<\/strong>. Count your php files with <code>find . -iname \"*.php\" | wc -l<\/code> to size max_accelerated_files.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b28 elementor-widget elementor-widget-heading\" data-id=\"b45a3b28\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Restart services safely and verify opcache enabled<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b29 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b29\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >Save changes and restart the relevant service: <code>sudo service apache2 restart<\/code> for Apache or <code>sudo service php7.x-fpm restart<\/code> for Nginx with PHP-FPM. Then reload phpinfo and make sure the cache shows as enabled. Check live stats; a rising hit rate means the cache is working. Adjust the revalidate interval in seconds for dev versus production so you don\u2019t force expensive file checks in live hosting.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b30 elementor-widget elementor-widget-heading\" data-id=\"b45a3b30\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Safe OPcache values for WordPress in 2025: the practical defaults<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b31 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b31\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><em>Tune defaults based on real metrics: hit rate, memory usage, and how many php files you have.<\/em><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b33 aligncenter size-large wp-image-11614 elementor-widget elementor-widget-image\" data-id=\"b45a3b33\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/boostedhost.com\/blog\/wp-content\/uploads\/2025\/08\/A-realistic-technical-diagram-showcasing-the-core-OPcache-settings-for-a-WordPress-website-1024x585.jpeg\" title=\"\" alt=\"A realistic, technical diagram showcasing the core OPcache settings for a WordPress website, set against a minimalist, office-like backdrop. The foreground features a sleek, metallic laptop displaying the key OPcache parameters, with the BoostedHost logo prominently displayed. The middle ground includes an array of server hardware, cables, and other IT equipment, conveying a sense of a modern, well-equipped web hosting environment. The background is softly lit, with a subtle grid pattern suggesting a data center or server room aesthetic. The overall mood is professional, informative, and focused on the practical optimizations needed for WordPress performance in 2025.\" loading=\"lazy\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b34 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b34\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><strong>Start simple:<\/strong> keep validate_timestamps=1 in production if you rely on auto updates, and choose revalidate_freq between 10\u201360 seconds. In development set revalidate_freq=0 so code changes show up immediately.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b35 elementor-widget elementor-widget-heading\" data-id=\"b45a3b35\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Memory and interned strings<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b36 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b36\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >Allocate memory in line with your plugin footprint. Most growing sites benefit from 256\u2013512 MB. Watch memory usage and raise the amount if the cache fills frequently.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b37 elementor-widget elementor-widget-heading\" data-id=\"b45a3b37\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">File counts and fast shutdown<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b38 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b38\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >Count php files with a quick find command and set max_accelerated_files above that number. Pick the next prime-like threshold to reduce hash collisions.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b39 elementor-widget elementor-widget-heading\" data-id=\"b45a3b39\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Compatibility and CLI<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b40 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b40\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >Keep fast_shutdown=1 and save_comments=1 for smoother shutdowns and compatibility with reflection-based tools. Enable CLI caching when you run frequent wp-cli or cron jobs so repeated runs reuse compiled scripts.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b41 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b41\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<blockquote > <p><strong>Rule of thumb:<\/strong> defaults work, but real gains come from matching memory and file index size to your codebase.<\/p> <\/blockquote>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b42 elementor-widget elementor-widget-heading\" data-id=\"b45a3b42\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">opcache settings wordpress: tune by symptoms, not guesses<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b43 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b43\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><strong>Start troubleshooting by reading live cache metrics instead of guessing what needs more memory.<\/strong> Use the runtime status to guide precise changes on your server.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b44 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b44\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><em>Read the numbers first.<\/em> If cache_full flips true and the hit rate drops below ~99% while no restart is pending, compare current wasted percentage to max_wasted_percentage. The usual solution is to increase memory_consumption.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b45 elementor-widget elementor-widget-heading\" data-id=\"b45a3b45\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">If the file index is full<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b46 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b46\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >When num_cached_keys equals max_cached_keys you\u2019ve hit the file ceiling. Run find project\/ -iname &#8220;*.php&#8221; | wc -l to count files and raise max_accelerated_files above that number.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b47 elementor-widget elementor-widget-heading\" data-id=\"b45a3b47\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">When restarts happen often<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b48 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b48\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >Frequent hash_restarts point to an index that&#8217;s too small. Frequent oom_restarts show memory pressure. If waste triggers restarts, raise max_wasted_percentage so fragmentation won\u2019t flush hot entries prematurely.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b49 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b49\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<blockquote > <p><strong>Quick rule:<\/strong> one targeted change at a time, then monitor for at least a day to confirm the solution.<\/p> <\/blockquote>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b50 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b50\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<table > <tr> <th>Symptom<\/th> <th>Metric to check<\/th> <th>Likely cause<\/th> <th>Action<\/th> <\/tr> <tr> <td>cache_full + hit rate \u2193<\/td> <td>opcache_hit_rate, memory_usage<\/td> <td>Not enough memory<\/td> <td>Increase memory_consumption; re-check after traffic<\/td> <\/tr> <tr> <td>num_cached_keys = max_cached_keys<\/td> <td>num_cached_keys, max_cached_keys<\/td> <td>Index limit reached<\/td> <td>Raise max_accelerated_files to match file count<\/td> <\/tr> <tr> <td>Frequent restarts<\/td> <td>oom_restarts, hash_restarts, last_restart_time<\/td> <td>Memory or index fragmentation<\/td> <td>Raise max_wasted_percentage or memory, track restart reasons<\/td> <\/tr> <\/table>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b51 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b51\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul > <li>Use opcache_get_status to inspect hit rate, wasted memory, and restart reasons.<\/li> <li>Count all php files (including vendor and generated code) so your file index has headroom.<\/li> <li>If multiple apps share a pool, size memory and file index by combined usage, not a single site.<\/li> <\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b52 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b52\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><strong>After changes<\/strong>, give normal traffic a full cycle before judging results. Track hit rate and restarts and repeat only if symptoms persist.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b53 elementor-widget elementor-widget-heading\" data-id=\"b45a3b53\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">WordPress-specific nuances that impact OPcache<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b54 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b54\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><em>Your site can accumulate thousands of small PHP modules from themes and extensions, and that changes how you size the bytecode index.<\/em><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b55 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b55\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><strong>Count your php files<\/strong> before you change defaults. Themes, mu-plugins, and plugins often add many entries that all count toward the file index. A quick find command gives you the number you need to set the accelerated files limit.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b56 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b56\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >Automatic updates mean files change at random times. If you rely on the platform&#8217;s auto-updates, keep validate_timestamps=1 with a moderate revalidate window so changes appear without manual restarts.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b58 aligncenter size-large wp-image-11626 elementor-widget elementor-widget-image\" data-id=\"b45a3b58\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/boostedhost.com\/blog\/wp-content\/uploads\/2025\/08\/A-close-up-view-of-various-software-plugins-and-modules-arranged-neatly-on-a-dark-textured-1024x585.jpeg\" title=\"\" alt=\"A close-up view of various software plugins and modules, arranged neatly on a dark, textured background. The plugins are rendered in a realistic, three-dimensional style, with intricate details and reflective surfaces. The lighting is soft and diffused, creating subtle shadows and highlights that accentuate the form and materiality of the objects. The overall mood is one of technical sophistication and attention to detail. In the foreground, a prominent plugin bears the logo &quot;BoostedHost&quot;, suggesting the importance of this particular component in the WordPress ecosystem.\" loading=\"lazy\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b59 elementor-widget elementor-widget-heading\" data-id=\"b45a3b59\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Deploys and teams<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b60 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b60\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >For teams using atomic deploys, you can disable timestamp checks and run a controlled reset after deploys. This is safe only if your automation reliably calls a reset or reload to avoid serving mixed code.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b61 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b61\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul > <li>Heavy builders and eCommerce extensions increase both memory and index needs \u2014 size for the worst case.<\/li> <li>Composer vendor directories count too; include them when you total php files.<\/li> <li>After adding or removing a plugin, revisit your numbers\u2014more code means more headroom is required.<\/li> <\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b62 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b62\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<table > <tr> <th>Scenario<\/th> <th>Risk<\/th> <th>Recommended action<\/th> <\/tr> <tr> <td>Many plugins and themes<\/td> <td>Index full, lower hit rate<\/td> <td>Increase max_accelerated_files; recount files<\/td> <\/tr> <tr> <td>Automatic updates enabled<\/td> <td>Stale or mixed code if not validated<\/td> <td>Keep validate_timestamps=1 and set revalidate_freq moderately<\/td> <\/tr> <tr> <td>Controlled deploys<\/td> <td>Possible downtime if not reset<\/td> <td>Disable validation only with automated opcache_reset or PHP-FPM reload<\/td> <\/tr> <\/table>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b63 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b63\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<blockquote > <p><strong>Quick tip:<\/strong> monitor after big plugin updates\u2014theme switches and new suites can shift memory and file needs overnight.<\/p> <\/blockquote>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b64 elementor-widget elementor-widget-heading\" data-id=\"b45a3b64\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Monitoring OPcache: plugins and dashboards that make it easy<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b65 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b65\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><em>A live dashboard makes it easy to spot when your cache needs more memory or a larger file index.<\/em><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b66 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b66\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><strong>Use a plugin if you work inside wp-admin.<\/strong> Plugins like OPcache Manager and WP OPcache show hit rate, used memory, and restart reasons without shell access. That is handy on managed hosts where you can\u2019t edit php.ini directly.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b67 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b67\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b68 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b68\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >If you prefer standalone tools, grab amnuts\u2019 OPcache GUI or PeeHaa\u2019s OpCacheGUI. Carlos Buenosvinos\u2019 dashboard, OCP, and CacheTool give deeper views and remote reset options. They help you act fast when a metric crosses a threshold.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b69 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b69\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<blockquote > <p><strong>Quick rule:<\/strong> watch opcache_hit_rate (~99% is healthy), used vs free memory, num_cached_keys vs max_cached_keys, wasted percentage, last_restart_time, and restart counters like oom_restarts and hash_restarts.<\/p> <\/blockquote>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b70 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b70\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul > <li>Install a plugin like OPcache Manager to see live stats inside the admin screen.<\/li> <li>Use standalone dashboards to visualize trends when you need more detail.<\/li> <li>Track hit rate, memory usage, cached keys, and restart counters regularly.<\/li> <li>Keep a short runbook: who checks dashboards, thresholds to act on, and the exact change to request from your host or apply safely.<\/li> <\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b71 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b71\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<table > <tr> <th>Tool type<\/th> <th>What it shows<\/th> <th>When to use<\/th> <\/tr> <tr> <td>Admin plugin (OPcache Manager, WP OPcache)<\/td> <td>Hit rate, memory, restart reasons in wp-admin<\/td> <td>Managed hosts or when you lack shell access<\/td> <\/tr> <tr> <td>Standalone GUI (amnuts, PeeHaa)<\/td> <td>Visual trends, per-script listing, reset options<\/td> <td>When you need quick visual inspection and resets<\/td> <\/tr> <tr> <td>CLI tools (CacheTool, OCP)<\/td> <td>Remote inspect, reset, and scripted checks<\/td> <td>Automation, CI\/CD, or when dashboards are unavailable<\/td> <\/tr> <\/table>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b72 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b72\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><strong>Make sure<\/strong> you check last_restart_time and restart counters to learn whether restarts are memory- or index-related. In many cases, the dashboard alone gives enough data to open a precise support ticket with your host.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b73 elementor-widget elementor-widget-heading\" data-id=\"b45a3b73\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Hosting realities: PHP-FPM pools, workers, and environments<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b74 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b74\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><em>Hosting choices shape how you size and run the bytecode cache across environments.<\/em> Development, staging, and production each have different trade-offs for code freshness, filesystem overhead, and peak request handling. Plan per environment so you don\u2019t surprise your server under load.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b75 elementor-widget elementor-widget-heading\" data-id=\"b45a3b75\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Separate dev vs production: timestamp validation and revalidate frequency<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b76 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b76\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><strong>In development<\/strong>, set opcache.revalidate_freq=0 so code changes appear immediately on each request. That avoids confusing stale behavior while you iterate.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b77 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b77\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><strong>In production<\/strong>, keep opcache.validate_timestamps=1 with a sensible revalidate window measured in seconds unless your deploys call opcache_reset automatically. Longer intervals reduce syscall overhead; shorter ones help deliver fresh code faster.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b78 elementor-widget elementor-widget-heading\" data-id=\"b45a3b78\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Multiple apps per FPM pool: size memory and file index together<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b79 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b79\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >If you host multiple applications in the same PHP-FPM pool, they share one cache instance. Size opcache.memory_consumption and max_accelerated_files for the combined footprint, not just a single site.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b80 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b80\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >Count php files across all apps and add headroom. If workers recycle often under burst load, enable fast_shutdown so processes exit cleanly and free memory quickly.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b81 elementor-widget elementor-widget-heading\" data-id=\"b45a3b81\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Coordinating cache with page caching and CDNs<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b82 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b82\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >Pair the bytecode cache with a full-page cache and a CDN so fewer dynamic php scripts must run. Page caching reduces backend requests, while the CDN speeds static assets to visitors.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b83 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b83\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<blockquote > <p><strong>Tip:<\/strong> use opcache_get_status during peak page demand to watch hit rate and num_cached_keys. Rising misses mean you should bump the file index or memory.<\/p> <\/blockquote>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b84 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b84\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul > <li><strong>Plan per environment:<\/strong> dev = instant checks, prod = measured revalidation in seconds.<\/li> <li><strong>Size for all apps:<\/strong> aggregate files and memory when pools are shared.<\/li> <li><strong>Coordinate tools:<\/strong> combine page caching and CDN to cut dynamic requests and reduce backend pressure.<\/li> <li><strong>Communicate with your host:<\/strong> if they control php.ini, give clear numbers for memory and file counts you need provisioned.<\/li> <\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b85 elementor-widget elementor-widget-heading\" data-id=\"b45a3b85\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Conclusion<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b86 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b86\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><strong>Conclusion<\/strong><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b87 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b87\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><em>End with one clear plan:<\/em> start with the safe defaults, then tune by watching real numbers. Count your php files, right-size memory, and pick a prime file limit above that count so the cache has headroom.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b88 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b88\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p >Make enabling opcache part of your deploy checklist. Use a dashboard or plugin to track hit rate (~99%), memory use, cached keys, and restart counters. If hit rate drops, add memory; if keys cap out, raise the file index; if restarts climb, relax the waste threshold.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b89 elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b89\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p ><strong>Do one change at a time<\/strong>, document why you chose those values, and re-check metrics over several hours. That steady approach keeps php performance stable, lowers server load, and keeps page load times and user experience reliably fast.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b45a3b90 schema-section elementor-widget elementor-widget-text-editor\" data-id=\"b45a3b90\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<section class=\"schema-section\"><h2>FAQ<\/h2><div><h3>How do I tell if OPcache is active on my server?<\/h3><div><div><p>Check phpinfo() or run php -i and look for the OPcache section. You can also use opcache_get_status() in a small PHP script or install a lightweight dashboard like OPcache GUI to confirm status, memory use, and hit rate.<\/p><\/div><\/div><\/div><div><h3>What default values are safe for most WordPress sites in 2025?<\/h3><div><div><p>For many sites, start with 128\u2013256 MB memory, 16\u201332 MB interned strings buffer, and a max accelerated files value that covers your theme, plugins, and core (often 10k\u201330k). Keep timestamp validation enabled in dev and reduce frequency in production for fewer checks.<\/p><\/div><\/div><\/div><div><h3>How much memory should I allocate for compiled PHP code?<\/h3><div><div><p>Pick a value based on your PHP file count and traffic. Small sites can use 64\u2013128 MB; busy sites or those with many plugins should use 256\u2013512 MB. Monitor actual usage and increase if the cache fills and hit rate drops.<\/p><\/div><\/div><\/div><div><h3>Should I enable OPcache for CLI scripts and WP-CLI?<\/h3><div><div><p>Enable it for long-running CLI tasks that benefit from cached compilation, but avoid it for short-lived commands if it causes confusing behavior. Use opcache.enable_cli selectively on environments where cron and background jobs are frequent.<\/p><\/div><\/div><\/div><div><h3>How often should files be revalidated in production?<\/h3><div><div><p>In production, set a lower revalidation frequency to reduce checks\u2014many teams use 60\u2013300 seconds or disable timestamp checks and trigger restarts on deploy. In development, leave validation enabled for instant updates.<\/p><\/div><\/div><\/div><div><h3>What do I do when the cache fills up and the hit rate drops?<\/h3><div><div><p>Increase memory_consumption first. If that doesn\u2019t help, raise max_accelerated_files to cover more PHP files. Also check max_wasted_percentage and restart reasons; frequent restarts may point to fragmentation or short lifespans.<\/p><\/div><\/div><\/div><div><h3>How do I choose max_accelerated_files for a WordPress install?<\/h3><div><div><p>Count PHP files in your site (core + theme + plugins). Pick a number comfortably above that count\u2014round up to the next sensible value. Monitor cached keys and adjust as your codebase grows.<\/p><\/div><\/div><\/div><div><h3>Which metrics should I monitor to know OPcache is helping?<\/h3><div><div><p>Watch hit rate, memory usage, number of cached keys, wasted memory, and restart reasons. A high hit rate and low wasted memory mean your cache is effective; dashboards and plugins can surface these quickly.<\/p><\/div><\/div><\/div><div><h3>Can automatic updates or frequent deploys break cached scripts?<\/h3><div><div><p>Yes\u2014deploys and updates change files, which can make cached entries stale. For production, prefer controlled restarts or cache resets at deploy time; in dev, keep timestamp validation on to pick up changes automatically.<\/p><\/div><\/div><\/div><div><h3>Do I need to coordinate OPcache with page caching and CDNs?<\/h3><div><div><p>Yes. OPcache speeds PHP execution, while page caches and CDNs reduce requests and latency. Use them together: OPcache lowers server CPU for uncached requests, and CDNs speed delivery to users.<\/p><\/div><\/div><\/div><div><h3>Which tools integrate well for monitoring and managing this cache?<\/h3><div><div><p>Use WordPress plugins like WP OPcache or external GUIs such as OPcache GUI and CacheTool. They let you inspect hit rates, memory, and keys, and perform safe restarts or clears when needed.<\/p><\/div><\/div><\/div><div><h3>How do PHP-FPM pools affect your cache choices?<\/h3><div><div><p>Each FPM pool has its own shared cache, so multiple pools mean duplicated memory use. Size memory_consumption and max_accelerated_files per pool based on the apps it serves to avoid wasted RAM.<\/p><\/div><\/div><\/div><div><h3>What causes frequent restarts and how can I fix them?<\/h3><div><div><p>Restarts come from max_wasted_percentage limits, memory exhaustion, or manual triggers. Address them by increasing memory, managing fragmentation with appropriate max_wasted_percentage, and reducing unnecessary restarts from deploy tooling.<\/p><\/div><\/div><\/div><div><h3>Is there a risk to enabling fast shutdown or saving comments?<\/h3><div><div><p>fast_shutdown helps cleanup and can speed worker shutdowns with minimal risk. save_comments preserves docblock info needed by some plugins and frameworks; disabling it may break reflection-based features, so keep it on unless you know you don\u2019t need it.<\/p><\/div><\/div><\/div><div><h3>How do I validate that my tuning actually improved page load times?<\/h3><div><div><p>Measure before and after using real-user metrics, synthetic tests (like WebPageTest), and server-side timing for PHP response times. Compare CPU usage and average PHP execution time to verify real gains.<\/p><\/div><\/div><\/div><\/section>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Fact: a well-tuned PHP bytecode cache can cut CPU use by half and shave seconds off peak page load times for busy sites. If you care about fast pages and lower server bills, this matters. OpCache stores compiled php code in shared memory so scripts skip parse and compile steps on each request. That reduces CPU spikes, improves scalability, and makes your visitor experience feel snappier. You\u2019ll get practical, production-safe defaults plus ranges to match small blogs or large builds. I\u2019ll show how to verify the cache is enabled, where common safe values start, and how to monitor hit rate, memory use, and restart reasons so you tune by real metrics\u2014not guesswork. Key Takeaways OpCache speeds PHP by serving compiled bytecode from memory. Verify it with a quick phpinfo check and look for the cache section. Start with conservative memory and file limits, then scale to fit your codebase. Watch hit rate, cache fullness, and restart reasons to tune safely. Use simple dashboards or plugins to track trends over time. Why OPcache matters for WordPress performance in 2025 When PHP bytecode stays in memory, each page view runs faster and uses less CPU. That basic change lowers disk I\/O and trims compile time on every request. For your site, this often means quicker page loads, steadier server response, and better website performance during traffic spikes. Lower server load gives your host room to handle more concurrent requests. That matters when a new post or promotion drives bursts of visits. Managed hosts usually include this cache, but you should confirm it is active and tuned to your plugins and theme footprint. Many page views run multiple PHP files; keeping compiled code hot avoids repeat work and delivers snappier pages. Faster pages improve user experience and help SEO because search engines favor sites that maintain speed as features grow. For WooCommerce or membership sites where hits bypass full-page caches, the gains in php performance are especially clear. What OPcache does for PHP and your WordPress site A warmed bytecode cache lets PHP run compiled files instantly instead of redoing work on every request. That cut in work shortens response times and keeps slow tails rare when traffic spikes. Faster execution by caching compiled PHP scripts Cached bytecode runs immediately. Rather than parsing source files on each hit, the engine executes precompiled units. This speeds up scripts and reduces the extra cycles spent rebuilding php code. Lower CPU and server load during traffic spikes Because compiled files live in shared memory, your server spends less time per request. That drop in server load prevents backlogs and keeps response times stable during bursts. Better user experience and SEO from quicker page load times Themes, builders, and plugins add many php scripts to each request. Keeping those compiled copies hot cuts redundant work, lowers disk I\/O, and yields faster page delivery. OpCache caches compiled php scripts in memory, avoiding repeated parse\/compile cycles. High hit rates mean fewer re-compilations and steadier times under load. Smaller CPU usage improves SEO signals by making pages reliably faster for visitors. How to enable OPcache on your hosting stack The quickest way to confirm caching is active is to load a tiny phpinfo page from your site root. Create a file named phpinfo.php containing &lt;?php phpinfo(); ?&gt; and open it in a browser. Look for the &#8220;OpCache&#8221; section to see current values and status. Check if OPcache is enabled via phpinfo and status Create phpinfo.php, refresh, and scan the report for the cache section. If you need metrics in code, drop a small script that calls opcache_get_status() to read used memory, cached scripts, and restart timestamps. Enable OPcache in php.ini or pool configs (Apache, Nginx with PHP-FPM) If the cache is missing, edit the PHP configuration file on your server. Typical paths are \/etc\/php\/7.x\/apache2\/php.ini or \/etc\/php\/7.x\/fpm\/php.ini. Add or adjust lines such as opcache.enable=1, opcache.memory_consumption=128, opcache.interned_strings_buffer=8, opcache.max_accelerated_files=10000, and opcache.revalidate_freq=60. Count your php files with find . -iname &#8220;*.php&#8221; | wc -l to size max_accelerated_files. Restart services safely and verify opcache enabled Save changes and restart the relevant service: sudo service apache2 restart for Apache or sudo service php7.x-fpm restart for Nginx with PHP-FPM. Then reload phpinfo and make sure the cache shows as enabled. Check live stats; a rising hit rate means the cache is working. Adjust the revalidate interval in seconds for dev versus production so you don\u2019t force expensive file checks in live hosting. Safe OPcache values for WordPress in 2025: the practical defaults Tune defaults based on real metrics: hit rate, memory usage, and how many php files you have. Start simple: keep validate_timestamps=1 in production if you rely on auto updates, and choose revalidate_freq between 10\u201360 seconds. In development set revalidate_freq=0 so code changes show up immediately. Memory and interned strings Allocate memory in line with your plugin footprint. Most growing sites benefit from 256\u2013512 MB. Watch memory usage and raise the amount if the cache fills frequently. File counts and fast shutdown Count php files with a quick find command and set max_accelerated_files above that number. Pick the next prime-like threshold to reduce hash collisions. Compatibility and CLI Keep fast_shutdown=1 and save_comments=1 for smoother shutdowns and compatibility with reflection-based tools. Enable CLI caching when you run frequent wp-cli or cron jobs so repeated runs reuse compiled scripts. Rule of thumb: defaults work, but real gains come from matching memory and file index size to your codebase. opcache settings wordpress: tune by symptoms, not guesses Start troubleshooting by reading live cache metrics instead of guessing what needs more memory. Use the runtime status to guide precise changes on your server. Read the numbers first. If cache_full flips true and the hit rate drops below ~99% while no restart is pending, compare current wasted percentage to max_wasted_percentage. The usual solution is to increase memory_consumption. If the file index is full When num_cached_keys equals max_cached_keys you\u2019ve hit the file ceiling. Run find project\/ -iname &#8220;*.php&#8221; | wc -l to count files and raise max_accelerated_files above that number. When<\/p>\n","protected":false},"author":2,"featured_media":11602,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[19,16,1],"tags":[399,395,398,397,396],"class_list":["post-11600","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hosting","category-web-hosting","category-wordpress","tag-accelerating-wordpress-with-opcache","tag-opcache-optimization","tag-opcache-safe-values","tag-php-caching-for-speed","tag-wordpress-performance-boost"],"_links":{"self":[{"href":"https:\/\/boostedhost.com\/blog\/en\/wp-json\/wp\/v2\/posts\/11600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/boostedhost.com\/blog\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/boostedhost.com\/blog\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/boostedhost.com\/blog\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/boostedhost.com\/blog\/en\/wp-json\/wp\/v2\/comments?post=11600"}],"version-history":[{"count":1,"href":"https:\/\/boostedhost.com\/blog\/en\/wp-json\/wp\/v2\/posts\/11600\/revisions"}],"predecessor-version":[{"id":11638,"href":"https:\/\/boostedhost.com\/blog\/en\/wp-json\/wp\/v2\/posts\/11600\/revisions\/11638"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/boostedhost.com\/blog\/en\/wp-json\/wp\/v2\/media\/11602"}],"wp:attachment":[{"href":"https:\/\/boostedhost.com\/blog\/en\/wp-json\/wp\/v2\/media?parent=11600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/boostedhost.com\/blog\/en\/wp-json\/wp\/v2\/categories?post=11600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/boostedhost.com\/blog\/en\/wp-json\/wp\/v2\/tags?post=11600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}