Squid3 error: “swap.state.new: (122) Disk quota exceeded” RESOLVED

We maintain a small outbound Squid proxy/cache server for our VPN users.  The Squid3 service on Debian 7 (Wheezy) died.  When we restarted the service, it would immediately termiate with these errors:

swap.state.new: (122) Disk quota exceeded
FATAL: storeDirOpenTmpSwapLog: Failed to open swap log.
Squid Cache (Version 3.1.20): Terminated abnormally.

The Squid service runs in a small Linux Vserver VPS with various CPU, memory, and disk restrictions.  I found that the VPS had reached its inode limit and could not create any new files.  Increasing the inode limit and restarting the VPS guest immediately resolved the problem.

Full error log output:

sudo tail /var/log/squid3/cache.log

2014/11/10 22:52:37| Starting Squid Cache version 3.1.20 for x86_64-pc-linux-gnu...
2014/11/10 22:52:37| Process ID 25908
2014/11/10 22:52:37| With 1024 file descriptors available
2014/11/10 22:52:37| Initializing IP Cache...
2014/11/10 22:52:37| DNS Socket created at [::], FD 7
2014/11/10 22:52:37| DNS Socket created at 0.0.0.0, FD 8
2014/11/10 22:52:37| Adding domain dnihost.net from /etc/resolv.conf
2014/11/10 22:52:37| Adding nameserver X.X.X.X from /etc/resolv.conf
2014/11/10 22:52:37| Adding nameserver Y.Y.Y.Y from /etc/resolv.conf
2014/11/10 22:52:37| helperOpenServers: Starting 5/5 'digest_pw_auth' processes
2014/11/10 22:52:37| Unlinkd pipe opened on FD 23
2014/11/10 22:52:37| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2014/11/10 22:52:37| Store logging disabled
2014/11/10 22:52:37| Swap maxSize 6291456 + 16384 KB, estimated 485218 objects
2014/11/10 22:52:37| Target number of buckets: 24260
2014/11/10 22:52:37| Using 32768 Store buckets
2014/11/10 22:52:37| Max Mem size: 16384 KB
2014/11/10 22:52:37| Max Swap size: 6291456 KB
2014/11/10 22:52:37| /cache/squid/swap.state.new: (122) Disk quota exceeded
FATAL: storeDirOpenTmpSwapLog: Failed to open swap log.
Squid Cache (Version 3.1.20): Terminated abnormally.
CPU Usage: 0.010 seconds = 0.005 user + 0.005 sys
Maximum Resident Size: 28096 KB
Page faults with physical i/o: 0

How to increase Linux Vserver VPS guest inode limit:

# View existing setting (500k files)
cat /etc/vservers/GUEST-NAME/dlimits/root/inodes_total
500000
# Edit setting
sudo vi /etc/vservers/GUEST-NAME/dlimits/root/inodes_total
# View new setting (1M files)
cat /etc/vservers/GUEST-NAME/dlimits/root/inodes_total
1000000
# Restart VPS guest
sudo vserver GUEST-NAME restart

Leave a Reply

Your email address will not be published. Required fields are marked *