Skip to content

cPanel quota cache stale — usage looks wrong, fix it

When a cPanel account shows 8 GB used but the home directory is 2 GB, the quota cache is stale. How to clear it cleanly without bouncing services.

A customer opens a ticket: cPanel says they’re at 8.4 GB out of 10 GB but their site is barely 2 GB. They’ve deleted everything they can think of and the number doesn’t move. Nine times out of ten this is the cPanel quota cache holding onto stale data, not a real disk usage problem.

What’s happening

cPanel maintains its own per-account usage figure that updates on a schedule (driven by Cpanel::Quota and the daily update_db_cache plus various event hooks). The kernel-level quota system updates more lazily — and on XFS the project quota model is different from ext4 entirely. When usage drops sharply (file deletion, mail purge), cPanel’s cached figure can lag the actual usage by minutes to hours. If the cache gets corrupt, by days.

How to verify

Compare what each layer reports:

quota -u <user>
du -sh /home/<user>
/usr/local/cpanel/bin/quota_cache --user=<user>
cat /var/cpanel/quota_cache/<user> 2>/dev/null

A divergence between du -sh and quota -u is real-disk vs kernel-quota. A divergence between quota -u and what WHM displays is cPanel-quota-cache vs kernel-quota. Identify which gap you actually have before fixing.

The fix

  1. Force cPanel to refresh the cached number: /scripts/update_db_cache followed by /usr/local/cpanel/scripts/fixquotas. The first updates cPanel’s view, the second rebuilds the kernel quota database from disk reality.
  2. For a single user only: /usr/local/cpanel/bin/quota_cache --user=<user> --rebuild and then reload the cPanel session — the WHM number reads from cache, not live.
  3. If fixquotas reports errors, look at /var/log/quota_repair_history.log. The common case is a filesystem mounted without quota options — confirm /home has usrquota,grpquota in /etc/fstab. If it doesn’t, mount options need updating and a remount.
  4. For XFS-formatted /home, the equivalent options are uquota,gquota,pquota and xfs_quota -x -c 'report -h' is the diagnostic.
  5. Avoid the bad habit of running fixquotas as a default response — it’s safe but heavy on big servers. Use it when the diagnostic above points to it, not preemptively.

Stack Harbor includes quota integrity checks in our cPanel server management monitoring set.