Article ID: 4250, created on Mar 24, 2008, last review on May 8, 2014

  • Applies to:
  • Sphera

Symptoms

Linux VDS shows incorrect quota in case of a very busy VDS

Resolution

Incorrect quota can be reported if a VDS is writing constantly to a log file, and the VDS owner logs in and deletes the file while it is being written.

We were able to reproduce this situation by bombing a VDS http service with "ab" utility and removing the Apache log files while Apache was writing into it. So user's disk usage stored as a part of user's quota information remained unsynchronized with user's real disk usage.

The VDS owner probably deleted a log while the process was writing to the log. For example, if the log file was the apache log file, and the VDS owner simply deleted it while the VDS is being accessed, then the Linux kernel does not have enough time to update the deleted log file in the quota database because apache constantly keeps writing to the access_log file, the file descriptor of the deleted access_log stays open until the parent process which opened the file is stopped.

The solution to this issue is to restart the process that occupies the file descriptor, in our example, apache. Once the file descriptor is released, the Linux kernel will update it automatically in the quota database without the need to run quotacheck.

5f478287f7e74fe9b07217d8131cd741 6311ae17c1ee52b36e68aaf4ad066387

Email subscription for changes to this article
Save as PDF