How to speed up WHMCS without touching its code
Is WHMCS slow? It's encoded and advises against OPcache, so its speed is set by the server around it. Eight changes we made, each one measured.

WHMCS runs the billing side of a great many hosting companies, ours included. It's also a closed book in one important way: its PHP is encoded with ionCube, so you can't read it, profile it or change it. And WHMCS's own guidance is to switch off OPcache, the cache that makes most PHP applications fast.
That sounds like the end of the conversation about performance. It isn't. WHMCS's own Optimize Performance guide covers the settings inside the application, such as ticket counts and debug logging, and is the place to start. This article is about what comes after it. When you can't change the application, its speed is decided by everything around it: the server, the disk, the database, the cron and the clock. In September and October 2026 we moved our WHMCS onto a server of its own and worked through each of those. This is what we changed, why, and what each change measured. Only one step, trimming a log table, touches WHMCS's own data, and it says so.
Why encoded software changes the job#
ionCube encoding protects WHMCS's source code and its licensing, which is a reasonable thing for a commercial product to want. The cost is that the usual way of speeding up a PHP application, finding the slow code and fixing it, isn't open to you. Every WHMCS request also runs through the ionCube Loader, which decodes the files as PHP reads them.
OPcache would normally hide much of that work by keeping compiled code in memory. WHMCS's OPcache guidance is plain about it: "We strongly discourage enabling OPcache on your WHMCS installation's server." It describes cached data that WHMCS can't control going stale, gives an example of that breaking WHMCS under PHP 8.1, and its page on cron crashes suggests switching OPcache off for the cron to test.
We follow that advice, and we'd suggest you do too. Our billing server handles a measured 23 requests a minute at its busiest, and a speed-up nobody would notice isn't worth a class of billing failures that someone certainly would. So the rest of this article is about the work you can do with OPcache off.
1Give it a server of its own, and choose the right class#
Our WHMCS used to share a server with the websites we host, so a busy website could slow down an invoice run. On 22 September 2026 it moved to a DigitalOcean server that runs WHMCS and nothing else, with 2 processors and 2 GB of memory.
The size matters less than the class of server. DigitalOcean's premium AMD class brings a faster processor and faster NVMe storage, and both show in the results. The next morning we ran the same benchmark on the same server twice: once on the regular class and once after resizing to premium AMD, keeping the same memory and processor count. DigitalOcean can only resize to a plan with at least as much disk, and a disk can grow but never shrink, so choose the resize that changes only processors and memory if you want to be able to go back.
| Measured 23 September 2026 | Regular | Premium AMD |
|---|---|---|
| A PHP workload, median of three runs | 0.156 s | 0.068 s |
| Both processors, sysbench | 698 events a second | 991 events a second |
| Random disk reads | 31,600 a second | 47,600 a second |
| Slowest single disk read | 355 ms | 7 ms |
The PHP test is a tight loop of arithmetic and hashing run by the server's own PHP, because WHMCS's cost is PHP's cost. It ran 2.3 times faster. The premium class costs more each month. For a system that every invoice, renewal and payment passes through, it's the cheapest speed you can buy, and the only change here that needs money rather than time.
2Spend the memory where WHMCS can use it#
With OPcache off, PHP reads WHMCS's files from disk and works out where each one lives on every request. Our installation has 49,534 PHP files taking up 305 MB. What makes that bearable is the operating system's own file cache, which keeps recently read files in memory. So free memory on a WHMCS server isn't wasted memory. It's doing the job OPcache would have done.
That changes how you size the database. The instinct is to give MySQL most of the memory. We started at 512 MB for InnoDB's buffer pool, against a database of 160.5 MB of data and indexes, then cut it to 256 MB and gave the rest back to the file cache. Measured with MariaDB's own counters on 8 October 2026, after seven and a half days running, more than a third of the pool's pages were still free, and only 10,348 of 371.7 million reads had to go to disk.
A few more settings help PHP find files quickly without caching any code, so none of them goes near WHMCS's advice:
; php.ini: remember where included files live, for longer
realpath_cache_size = 16M ; default 4M, which a codebase this size outgrows
realpath_cache_ttl = 600 ; default 120 seconds
# sysctl: keep file and directory details in memory, and swap late
vm.vfs_cache_pressure = 50 # default 100
vm.swappiness = 10 # Ubuntu's default is 60
When the realpath cache fills, new paths stop being cached and PHP doesn't warn you, which is why the default is worth raising. The swap setting tells Linux to keep the database's memory in memory. We still keep a 2 GB swap file, as a safety net for a heavy cron run that overlaps a backup rather than something to use every day.
To check your own buffer pool, compare Innodb_buffer_pool_reads with Innodb_buffer_pool_read_requests. If the first starts climbing against the second, the pool has become too small.
3Tell the ionCube Loader where to look#
The user guide that comes with the ionCube Loader recommends one setting for performance. Normally the Loader checks every PHP file to see whether it's encoded. Given a path, it only checks files there:
ioncube.loader.encoded_paths = /var/www/whmcs
On local fast storage the gain is small. It costs nothing, and it's the vendor's own advice. The path has to cover every encoded file you run, including any encoded add-on modules, and the crons folder if you've moved it out of the website's folder, as WHMCS recommends. Set it too narrowly and encoded files outside it won't be decoded, so test every part of WHMCS, add-ons included, after the change, and check the path again after each upgrade or new add-on. Put it in the command-line PHP settings as well as the web ones, so the cron and the website behave the same way.
4Set the database up the way WHMCS expects#
MySQL since 5.7 and MariaDB since 10.2.4 turn on strict mode by default. WHMCS doesn't support it, and its guide to disabling strict mode says that enabling it "can cause serious problems". The trouble is when they show: not at installation, but as an insert failing in the middle of an invoice run.
[mysqld]
sql_mode = NO_ENGINE_SUBSTITUTION
One trap when applying it to a running server: WHMCS's database user rightly can't change global settings, so a SET GLOBAL run with its credentials fails with "Access denied". If nothing checks the error, it looks exactly as if it worked. Put it in the configuration file and restart instead.
5Put fast disks on the right scheduler#
Linux places requests to a disk in a queue and reorders them, which helped spinning disks whose heads had to travel. Solid-state storage has no head and a deep queue of its own, so reordering is work for nothing. The scheduler called none passes requests straight through.
There's a catch on many cloud servers. The usual rule only applies to disks that report themselves as not rotating, and virtual disks often report the opposite, so the rule never fires. We match the disk by its name instead:
# /etc/udev/rules.d/60-scheduler.rules
ACTION=="add|change", SUBSYSTEM=="block", KERNEL=="vd[a-z]", ATTR{queue/scheduler}="none"
Check what yours uses first, in /sys/block/vda/queue/scheduler, because some systems already choose none. Ours was on mq-deadline. Only do this where the disks it matches are solid-state, which is true of DigitalOcean's server disks.
6Make every clock agree#
WHMCS's daily automation runs at an hour you choose in its settings, by PHP's clock. The catch is that the web server's PHP and the command-line PHP that runs the cron read separate settings files, so they can disagree, and the server keeps its own clock, which the database normally follows. When they differ, the daily run happens at the wrong hour and dates come out wrong. WHMCS's timezone troubleshooting page lists the symptoms, including two-factor codes being rejected, which happens when the server's clock itself is wrong, so keep it synchronised too. Set date.timezone in both PHP settings files, and keep the server in the same zone. We use Europe/London, because that's what every invoice we've ever issued was dated in, but any zone works if they all agree.
If you use a zone with daylight saving, keep the daily automation out of the small hours. In the UK the hour from 1 am happens twice in October and not at all in March, so a daily run set in that hour can be delayed or skipped. In the UK, any hour from 2 am onwards avoids it. Elsewhere, check when your zone changes.
7Give the cron jobs room#
Every WHMCS cron run starts WHMCS from nothing, and with OPcache off that means decoding and compiling its code each time. That's fine on its own. It isn't fine when several start in the same second on a two-processor server.
Our status page checks the billing system every minute. Over a day, the readings at exactly the hour and the half hour averaged 3.4 seconds, against about 0.9 seconds for the other minutes. Watching the server at 6 pm showed why: WHMCS's main cron, its email campaign tasks, the ticket import, our own monitoring and a report all started together, and our monitoring was also asking the package manager for pending updates, the most expensive job of the lot.
Three changes made the difference, and none of them moves WHMCS's own schedule:
- Run every job at low priority. Putting
nice -n 10in front of each cron command means a customer's page request gets most of the processor time whenever the two compete, and the job takes a moment longer. It doesn't lower the priority of the job's database queries, which the database runs as normal. One check on servers run by systemd: if/sys/fs/cgroup/system.slice/cgroup.subtree_controllistscpu, each service gets its own share of the processors andnicecan't reach across them, so lower the cron service'sCPUWeightinstead. Ours doesn't, soniceworks as intended. - Move your own jobs off the busy minutes. WHMCS's main cron runs every five minutes, so anything of yours can sit at 7, 22, 37 and 52 minutes past instead of on the hour.
- Make your own checks cheap. Ours now only counts pending updates when the package lists have changed, rather than every fifteen minutes.
The first two half-hour readings after the change averaged 2.1 seconds, down from 3.4, and the other minutes stayed at about 0.9. That's an early figure, not yet a day's average, and what remains is WHMCS's own cron starting its tasks together.
Two cron details are worth checking while you're there. WHMCS's cron takes arguments, such as do --TicketEscalations, and WHMCS says they need PHP's register_argc_argv setting on. Command-line PHP normally turns it on by itself, but check it if your cron calls PHP some other way. And if you import support email by POP, that's a separate job, crons/pop.php, as WHMCS's cron documentation explains. The main cron doesn't do it.
8Trim the log nobody reads#
WHMCS keeps a row for every task in every cron run in a table called tbllog_register, which feeds its Automation Status page. Most of those rows record that nothing happened: "0 emails sent". On our server that was 3,400 rows a day, 98.5% of them zeros, and the table had reached 52 MB.
WHMCS has no built-in tool for trimming it, though there's a feature request for one, so this is the one step here that changes WHMCS's database directly. A nightly job now removes zero-value rows after 7 days and everything else after 90, which keeps three months of history behind Automation Status. Try it on a copy of the database first, take a backup before the first real run, and keep it out of the hour your daily automation runs.
What it adds up to#
None of these changes makes WHMCS do less, and only the log trim touches WHMCS's own data, which is why it comes with a backup. Together they give it a fast processor, a file cache with room to work, a database configured the way it expects, and a cron that no longer gets in its own way. The measurements came from the server and the status page, not a lab, which is how we measure the rest of our own systems too. Every setting above is one you can try on your own installation, one at a time, with a reading before and after.
If your WHMCS is slow and you'd rather someone else did the measuring, tell us what you're seeing. We'll take a look, tell you what we'd change, and quote you for the work before we change anything.


