Why SuiteCRM 8 production servers need OPcache and APCu tuned
A team running SuiteCRM 8 on its own PHP stack should not assume the default caching settings are enough for production. OPcache stores compiled PHP bytecode in shared memory so that PHP does not parse and compile the application's files on every request. APCu is a separate user data cache that lets the application keep values in memory between requests. Both reduce work on each page load, but they do different jobs and fail in different ways, so each needs a deliberate decision rather than whatever the package ships with.
SuiteCRM 8 runs on PHP, and the supported PHP versions for SuiteCRM 8.10 are 8.2, 8.3 and 8.4, according to the SuiteCRM 8 compatibility matrix. Confirm the exact PHP build your team runs against that matrix before tuning, because the OPcache and APCu settings you choose must match the PHP packages on the server. Settings that work on one PHP minor version may need a different memory allocation on another, and a mismatch between the web server SAPI and the command-line SAPI can also cause confusion when the scheduler and the Messenger worker behave differently from the web requests.
This page covers the recommended OPcache values, the trade-off of turning off opcache.validate_timestamps in production, how much memory APCu uses and how to clear caches during a deploy, and the security points that follow from keeping compiled code and cached data in memory. Plan to test these settings on a staging instance first, and record the values you choose so that a later SuiteCRM minor release, which may change the file layout, can be deployed without guessing which cache state was in effect.
OPcache and APCu settings for SuiteCRM 8 and when each one fits
This table compares the main OPcache directives and APCu settings that affect a SuiteCRM 8 production server, with what each controls, when to change it and the trade-off. Size every value from your own file count and measured memory use rather than copying figures from a blog post, and treat the production column as the setting to verify on staging first.
| Setting | What it controls | When to change it | Trade-off |
|---|---|---|---|
| opcache.memory_consumption | Shared memory reserved for cached compiled PHP bytecode | When status reports show the cache filling up or restarting, or after adding modules and extensions | More memory is held by PHP workers permanently, even when idle |
| opcache.interned_strings_buffer | Shared memory for interned strings such as class and function names | When the cache reports the interned strings buffer is full on a large codebase | Raising it uses memory that could go to bytecode storage |
| opcache.max_accelerated_files | Maximum number of PHP files the cache can hold at once | When the file count of SuiteCRM plus custom modules and vendor packages exceeds the limit | Each slot consumes memory, and the value is rounded up to a prime number internally |
| opcache.validate_timestamps | Whether PHP checks file modification times on each request | Turn off in production only if every deploy restarts PHP-FPM or Apache and clears OPcache | Off means code changes stay invisible until restart, so a missed reload serves stale code |
| opcache.revalidate_freq | Interval in seconds between timestamp checks when validation is on | Raise it on servers where code changes are rare but validation is still wanted | Higher values delay picking up changes; lower values add filesystem checks per request |
| apcu shared memory size (apc.shm_size) | Memory for user data cache used by SuiteCRM and its libraries | When cache entries are evicted under load or the APCu status shows near-full usage | Memory is reserved at startup whether or not the cache is used |
| apc.enable_cli | Whether APCu is active for command-line PHP, including scheduler and worker processes | Enable only if CLI jobs depend on shared cache, and test scheduler and Messenger runs afterward | CLI processes keep separate caches that can behave differently from web requests |
| apc.ttl | How long an entry stays cached before expiry, with 0 meaning no time limit | Set a limit when entries must refresh on a schedule or when memory pressure needs older entries removed | Short TTLs raise cache misses; long or unlimited TTLs keep stale values until eviction |
What turning validate_timestamps off changes on every deploy
With opcache.validate_timestamps set to off, OPcache stops checking source files for changes and serves the compiled code it already holds. That saves a filesystem check on each request, but it also means a deploy is invisible to PHP until the cache is reset or the PHP-FPM workers are restarted. A SuiteCRM 8 release that lands on disk without a cache reset keeps running the old compiled code, and the new files may not match what the process is executing. Treat the reset as part of the deployment itself, not as a follow-up task for an administrator.
The risk is sharpest during a rolling deploy. If workers or servers are updated one at a time, some requests can run the new code while others still run the old compiled copy, and the mix can produce errors that look random. Before choosing this setting, confirm with your own platform team how your PHP-FPM setup reloads (a graceful reload, a service restart or a per-pool reset) and whether that reset reaches every worker. The exact method depends on your init system and process manager, so verify it on staging rather than assuming it.
On a single server, the deploy script can reset the cache once, after files are in place and before traffic returns, and the window of inconsistency is short. In a multi-server pool, each node needs its own reset, the load balancer must stop sending traffic to nodes that have not yet reloaded, and monitoring should confirm that every node reports the new version. The trade-off is therefore larger for pools. Ask your team to document the reset order, the health check that gates each node, and the rollback step that restores the previous code and reset cache together.
Choosing OPcache and APCu settings for staging, single-server and multi-server production
On a staging or test instance, the priority is that code changes show up immediately. Developers, administrators and testers often copy in new customizations, run upgrades or change configuration several times a day, so caches that hold on to old code cause confusing results. For this environment, keeping opcache.validate_timestamps enabled is usually the sensible choice, because PHP then checks file timestamps and picks up edits without a restart. Speed matters less here than accuracy, and a short, predictable feedback loop is what the team needs.
- Timestamp checks on: Leave
opcache.validate_timestampsset to 1 so edited files are re-read. - Short revalidation interval: Keep
opcache.revalidate_freqlow so changes appear quickly. - APCu cleared after each change: Clear APCu when you deploy customizations, since stale entries can hide a fix.
- Separate pool or host: Avoid sharing the staging PHP-FPM pool with production so test changes never touch live traffic.
- Production-like settings for final tests: Before sign-off, run one test pass with production-style settings to catch problems that only appear with caching on.
After any change, confirm that a modified template or custom file shows its new behavior on the first request, and that the scheduler and Messenger worker still pick up code updates. Confirm exact values with your own test plan.
On a single production server, OPcache and APCu both live in one PHP process pool, so the settings are simpler but still matter. The main trade-off is between speed and the risk of serving old code after a release. Turning off timestamp validation gives the best performance because PHP stops checking files on each request, but it means every release must reset the OPcache explicitly. Many teams accept this for production because releases are planned and controlled, provided the deployment steps include a cache reset.
- Timestamp checks off, with a reset step: Setting
opcache.validate_timestampsto 0 avoids file checks, but the deployment must reload PHP-FPM or otherwise clear OPcache. - Adequate OPcache memory: Size
opcache.memory_consumptionto hold the full SuiteCRM codebase with headroom, and watch for cache-full messages in logs. - APCu sized for the working set: Set
apc.shm_sizeto a value that holds SuiteCRM's cached data without eviction, and monitor it after a release. - Clear APCu on deploy: Clear APCu as part of each release so cached metadata matches the new code.
- Documented rollback values: Record the previous settings so you can revert quickly if a release misbehaves.
After each release, check the OPcache status, confirm that the new version string appears in the admin area, and watch error logs for undefined class or stale template errors. Confirm the values against a load test on your hardware.
In a load-balanced pool with several PHP-FPM hosts, each host has its own OPcache and its own APCu memory. A user's requests can land on any host, so a release that reaches only some hosts produces mixed versions of the application. OPcache is per host and cannot be shared, while APCu is also per host unless you deliberately design around it. The aim is that every host reaches the same code and cache state at the same point in the rollout.
- Consistent code on every host: Deploy to all hosts before switching traffic, or use a rolling method that clears caches on each host as it updates.
- Per-host cache reset: Reset OPcache and APCu on each host as part of the release, not only on one node.
- Matching settings across hosts: Use the same OPcache and APCu configuration everywhere so behavior does not differ by node.
- Memory budgets per host: Size APCu for each host's own memory, because the pool does not share it.
- Session and file handling checked: Confirm that sessions and shared file storage work across hosts, since caching does not fix those.
After a change, check each host individually rather than only the load balancer address, and confirm that all nodes report the same application version. Ask your platform team to confirm the reset mechanism and load-test the rollout order in your own environment.
How to enable and verify OPcache and APCu in order
This sequence takes a SuiteCRM 8 server from an unconfigured PHP runtime to tuned OPcache and APCu settings that are verified, tested on staging and recorded for the next rebuild.
Confirm PHP and extensions against the matrix
The administrator checks the SuiteCRM 8 compatibility matrix for the exact release in use, then confirms the PHP version, the Apache version and the database engine on the server. The PHP version must be one the matrix lists for that release (the matrix covers PHP 8.2, 8.3 and 8.4 for SuiteCRM 8.10). Run php -v and php -m to confirm the opcache and apcu modules are present or available as packages. Done when the version and module list are written down and match the matrix row for your release.
Enable OPcache and APCu in the pool
The platform or web engineer adds the OPcache and APCu directives to the PHP-FPM pool configuration for the SuiteCRM site, not only to the global php.ini, so that settings stay tied to the application. Start with validate_timestamps enabled on the first pass so that code changes are picked up during setup. Keep the values in a single include file under configuration management. Done when php-fpm -t reports a valid configuration and the directives appear in the output of php -i for the pool user.
Set memory and file limits from measured values
Before choosing numbers, the administrator measures the size of the SuiteCRM codebase and the memory the PHP-FPM workers use under realistic load on staging, then sets opcache.memory_consumption, opcache.max_accelerated_files and apc.shm_size from those measurements with headroom. Ask your SuiteCRM partner or vendor for guidance on expected footprint, and treat any published default as a starting point rather than a target. Done when the limits are recorded with the measurement that produced them, and the values can be justified to a reviewer.
Restart PHP-FPM and confirm the new settings
The administrator reloads PHP-FPM so the pool picks up the new configuration, then checks that the service is healthy and that no worker is failing to start. Use the service manager status command and the PHP-FPM error log to confirm the restart is clean. Check that the OPcache and APCu settings reported by a command-line query match the file contents. Done when the service reports active, the error log shows no new warnings for the pool, and the reported values match the file.
Check hit rate and memory on a private status page
The administrator reviews OPcache and APCu hit rates, free memory and cache restarts through a status script that is reachable only from the administration network or over a local socket. Do not expose the status page publicly, because it reveals server details. Load the SuiteCRM login and several list views, then reread the statistics. Done when hit rates are high after warm-up, free memory stays above the margin you set, and the status page returns a denied response from a public address.
Test a deploy on staging with the chosen timestamp setting
The release engineer deploys a SuiteCRM change to the staging instance using the planned process, first with validate_timestamps enabled and then with it disabled if that is the production choice. With validation off, the team must clear or reload OPcache as part of the deploy, and must check that APCu entries from the old release are cleared as well. Confirm the new code is served and that old pages do not return. Done when both deploy paths are tested, the reload or clear step is written into the runbook, and a request after deploy returns the new behavior.
Record the settings in configuration management
The platform engineer commits the final PHP-FPM pool file, the OPcache and APCu values, the measurement notes and the deploy step for cache clearing to the configuration repository, with a reviewer. The record names the SuiteCRM release, PHP version and the timestamp setting chosen. Confirm that a fresh build from the repository produces the same effective values, using the same verification commands as earlier steps. Done when a rebuild on a clean host reports identical settings and the runbook links the record.
How a SuiteCRM request, the caches and the deploy step fit together
A browser request enters through Apache and PHP-FPM, where OPcache serves compiled bytecode and APCu holds cached data, and SuiteCRM then reads the database and file storage. The deploy pipeline is the only path that resets OPcache and clears SuiteCRM caches, so it runs inside the trusted server boundary. Check that status pages and cache reset endpoints are reachable only from administrative networks, and that validate_timestamps is handled as part of every release.
Request path, cache layers and the deploy reset inside the server boundary.
Clearing OPcache, APCu and SuiteCRM caches on each deploy
Each deploy should follow a fixed order: put the new code in place, reset OPcache in every PHP-FPM worker pool, clear APCu where the application uses it, and then clear SuiteCRM's own cache with its console commands. The order matters because OPcache serves compiled bytecode. If you clear SuiteCRM's cache before the new files are on disk, the application can rebuild its cache from old code and store the stale result. Resetting OPcache before the files are in place has the same problem in reverse, since a worker can recompile the old source straight back into memory.
A reset only reaches the processes it is sent to. OPcache lives in the memory of each PHP-FPM worker pool, and a pool on one web node has no view of another node's memory. On a multi-node stack, a reset run on one host leaves the others serving old code. Build the reset into your deploy tooling so it runs against every node and every pool, and check each node afterward instead of assuming the first one is representative. A partial reset looks like a site that behaves differently depending on which node answers: a form that is fixed for one user still fails for the next, or a new field appears on some pages and not others. Users may report it as intermittent, which makes it harder to trace.
Confirm the exact SuiteCRM 8 cache console command for your release, and whether it must run with the same PHP user and environment as the web server. Also confirm whether the release you are deploying needs a maintenance window, using the SuiteCRM 8 documentation for that version. Do not assume the command or its timing carries over from an earlier release. Test the full sequence on a staging instance that matches production's node count and PHP-FPM layout before you rely on it.
Security and operational risks of cache settings
OPcache and APCu make SuiteCRM faster, but they also expose internal state, hold data in shared memory and can serve stale code after a bad deploy. The cards below pair each risk with the control that keeps it contained on a self-hosted SuiteCRM 8 server.
Exposed status and reset endpoints
Status scripts such as opcache_status or APCu info pages reveal file paths, memory layout and cache keys, and reset endpoints let anyone with the URL clear the cache. Keep these scripts out of the web root or behind an IP allowlist and authentication, and confirm with a request from outside your network that they return no content. Remove any test file left after troubleshooting.
Per-user data in shared APCu
APCu memory is shared by every PHP-FPM worker on the host, so anything SuiteCRM stores there is visible to all sessions on that pool. Confirm which keys the application and its extensions write to APCu, and do not place session data, tokens or user-specific records there unless your configuration intends it. Separate pools for separate SuiteCRM instances prevent one site reading another's entries.
Stale code after an incomplete deploy
With opcache.validate_timestamps off, PHP keeps serving the compiled files it loaded first, so a deploy that copies new files but skips the reload can run mixed old and new code. Make the deploy script reload PHP-FPM and clear APCu as its last step, and check a version string on a test request before you return the site to users. Record which release each node is running.
Memory exhaustion and cache evictions
When OPcache or APCu fills, PHP evicts entries or, for OPcache, stops caching new scripts, which slows requests and can surface as memory errors under load. Size opcache.memory_consumption and the APCu shared memory limit from measured usage on a staging copy of SuiteCRM, not from defaults. Alert on the free memory and restart counters after every release.
Hit rate and cache health monitoring
A falling OPcache hit rate or rising cached-key churn is often the first sign of memory pressure or a misconfigured deploy, yet it rarely triggers an error page. Export the OPcache and APCu counters to your monitoring stack, set alerts on sustained low hit rates and on restarts, and review them after each SuiteCRM upgrade. Ask your implementation partner which thresholds they used and why.
PHP version support and patching
OPcache and APCu are only as current as the PHP build under them, and SuiteCRM 8.10 supports PHP 8.2, 8.3 and 8.4. When a PHP branch leaves security support, the cache settings need retesting on the new version, not just a package update. Track the PHP lifecycle against your SuiteCRM release, and schedule the move to a supported PHP version before the old one reaches end of support.
Compatibility matrixQuestions teams ask about OPcache and APCu for SuiteCRM 8
Does tuning OPcache and APCu for SuiteCRM 8 cost much, and do we need a partner?
The settings themselves are a small change, so the cost sits in the work around them: reading your current PHP-FPM or Apache setup, changing values, load testing on a staging copy and checking the result. Your internal team can make the change if they already run PHP production servers. A partner is useful when you want the tuning measured against your real traffic, written into your deploy runbook and verified after each SuiteCRM minor release. Ask any quote to itemize the server review, the staging test cycle, the runbook and any retainer for re-checks after upgrades, and to state who performs each step.
How long does OPcache and APCu tuning take, and what makes it longer?
Duration depends mostly on how many servers you run, how varied your traffic is and whether you have a staging copy that resembles production. A single web server with a staging instance is a short exercise. Multiple nodes behind a load balancer, separate worker hosts and a deploy process that restarts PHP unevenly add time because each change must be verified on every node. Ask the quote to state the number of nodes covered, the test scenarios used to compare before and after and the criteria for accepting the change. No duration is given here because your environment sets it.
What must our team provide before tuning starts?
Prepare the inputs that decide the settings, so the work is not guesswork. Typically you will need:
- The PHP version and SAPI in use, checked against the SuiteCRM 8 compatibility matrix for your release
- Server sizes for web and worker hosts, including available memory and CPU
- The current
php.iniand pool configuration, plus any existing OPcache or APCu values - Your deploy tooling, including whether releases are symlinked, rsynced or built in place
- A staging copy with a recent database and file snapshot, so you can run real requests against it
Also confirm who can restart PHP-FPM or Apache during a release window.
Can an internal administrator tune OPcache and APCu without outside help?
Yes, if the administrator is comfortable with PHP configuration, Linux service management and load testing. The core settings are documented in the PHP and APCu manuals, and SuiteCRM does not require a special cache configuration beyond what its installation guide asks for. The risk lies in unmeasured changes, such as a large OPcache memory limit that starves the host or an APCu size that evicts entries under load. Ask whether your administrator will measure hit rates and memory use before and after, and whether the change is recorded in your runbook for the next release.
Is setting validate_timestamps off safe with our deploy process?
It is safe only if every deploy also clears or restarts the PHP process that serves requests. With opcache.validate_timestamps set to off, OPcache stops checking whether source files changed, so PHP keeps serving the old compiled code until the cache is reset or the process restarts. Check how your pipeline switches code, whether it replaces files in place or changes a symlink, and whether each web node gets the reset. Also plan for the worker processes, which hold their own cache state. A staging test that deploys a change and confirms the new behavior on every node is the simplest proof.
How do OPcache and APCu settings interact with the Messenger worker and scheduler?
Cron-driven scheduler runs and the long-running Messenger worker are separate PHP processes, so they do not share the web tier's OPcache or APCu contents in the way web requests do. A worker that runs for a long time keeps the code it loaded at start, so a deploy that changes code must restart the worker as well as the web tier. Check that the scheduler user and the worker user can read the same files and that restarts are part of the release steps. Confirm the exact behavior for your SuiteCRM version with the vendor documentation before you finalize the runbook.
What should we check after the settings change?
Check three things: that the cache is being hit, that memory use stays within the limit you set on each host and that a release leaves no stale code behind. Watch the hit rate and the number of cache restarts over a normal business day, and record the memory headroom at peak. Then run a deploy on staging and confirm that web pages and background jobs show the new code. Ask any quote to include these checks and the written result for each node, so you can repeat them after SuiteCRM minor upgrades.
Limits to confirm in your environment before changing cache settings
OPcache and APCu settings only help if they fit your PHP build, your SuiteCRM release, your hosting platform and your deployment path. The cards below list what to confirm first, because a setting that works on one host can be wrong on another.
PHP version and extension build
Confirm the PHP version and the OPcache and APCu extensions that ship in your SuiteCRM package or server image. SuiteCRM 8.10 supports PHP 8.2, 8.3 and 8.4, so check which of those your web server actually loads. Run php -v and php -m on each web node, because a version or module mismatch between nodes changes which settings apply.
- Supported PHP versions
- 8.2 to 8.4
Release-specific cache requirements
Check the SuiteCRM release you run and whether its documentation names any cache requirement or supported OPcache configuration. Minor 8.x releases arrive roughly every eight weeks, so a setting you validated on one release should be rechecked after an upgrade. Record the release number next to every cache change so you can trace a regression to its cause.
- Minor release cadence
- 8 weeks
Hosting platform restrictions
Ask your hosting provider whether they allow changes to opcache.validate_timestamps or APCu memory, and whether they restart PHP-FPM or Apache on your behalf. Shared and managed platforms often fix these values or reset them during maintenance. A setting you cannot control or persist makes the cache plan unreliable.
Memory available per host
Confirm how much RAM each web node can give to OPcache and APCu after PHP-FPM workers, the database client and the operating system are counted. Cache memory is reserved per process pool, so a generous limit on a small VM can push the host into swapping. Agree the budget with your platform team before you raise any limit.
Vendor-named OPcache configuration
Find out whether the SuiteCRM documentation for your release names a supported OPcache configuration. If it does not, treat any values you copy from forum posts or generic guides as your own decision, and test them on staging. Ask your implementation partner or SuiteCRM support to confirm the values in writing before they go into production.
Load balancer and container deploy paths
Check whether a load balancer, container platform or rolling deploy sends requests to every node at the same moment. If nodes receive new code at different times, a shared APCu cache or a stale OPcache entry can serve mixed code to users. Decide whether each node clears its own caches after deploy, and whether a restart or a rolling replacement is the safe path.
How DeployOpen works on this
DeployOpen plans, implements and hardens self-hosted open-source platforms inside your own infrastructure, including the PHP caching layer for SuiteCRM 8. Cache settings are set against your server sizing, deployment process and security review, then documented so your team can operate them after handover.
How we scope
- The written scope lists the PHP and web server versions, the SuiteCRM 8 release, and the servers that will run OPcache and APCu.
- Scope records whether validate_timestamps stays on or off, and which deploy steps clear caches.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
How we build
- We set OPcache memory, file and interned string limits against the SuiteCRM codebase on your staging instance.
- We size the APCu memory limit and confirm which SuiteCRM features rely on it in your environment.
- We script the cache clear step into your deploy process and test it on a staging instance before production.
How we hand over
- You receive the final php.ini and pool settings, with each value explained against your server size.
- A runbook covers how to clear OPcache and APCu, how to check hit rates and what to do after each deploy.
- Our testing covers page loads after a deploy with caches cleared and with caches warm, so you can compare results.
How we support
- Settings are reviewed again when you move to a new SuiteCRM 8 minor release or change PHP versions.
- Ongoing support, upgrades and continuous testing are available as a retainer for your SuiteCRM hosting.
- Ask any provider to confirm in writing which cache settings they will change and which they will leave at your defaults.

