Discus Home Page  |   Knowledge Center  |   Administration Instructions

Options Manager -- File Locking/Quota Checking

These options are set from the Other tab of the Options Manager interface.

Why Quota Checking and File Locking?

Because Discus uses flat text files to maintain certain crucial board information (such as your message pages), it must itself deal with two situations that commonly affect customers of web hosts. These situations are running out of disk space and simultaneous access to files.

Quota checking: When writing important files, Discus reads data from the source file and writes out the modified version of the file in a separate directory. It then checks to see that the size of the file that was written out matches the expected size of the file. If so, the new file replaces the old file.

File Locking: When Discus needs to update a file, it first establishes a "lock" on the file. It then reads the file, manipulates the data, and writes out the new version of the file (perhaps using quota checking as described in the previous paragraph). When it is finished, it "unlocks" the file, so that other processes can update the file as needed.

If quota checking or file locking were not used, serious corruption of data could result. If the disk quota is exceeded, upon update, files are written out with 0 length (which basically means an empty file is created, wiping out all of the data previously in the file). If two processes write to the file at the same time, data loss or incorrectly interspersed text can result.

The default mechanism of file locking is for Discus to create a directory in the 'locks' directory of your discussion board when it locks a file. Since directory creation will fail if the directory already exists, this is essentially air-tight in preventing conflicts due to file locks. The other options allow you to specify other options, but the other options are less reliable than this default.

If you have enabled the MySQL database option, file locks are handled through the MySQL database using an equally robust mechanism.

Configuring Quota Checking and File Locking

UNLESS YOU HAVE A VERY GOOD REASON TO DO SOMETHING ELSE, YOU SHOULD HAVE THESE OPTIONS CHECKED ([X]) OR UNCHECKED ([ ]) ACCORDING TO THESE GUIDES.

If you change any of these settings from their recommended defaults, DiscusWare will not provide any support for the consequences!

  • [X] Disk quota checking: Disable board immediately if quota problem detected: If checked (recommended), Discus will shut down the board if a disk quota problem is detected. This protects all of your files against corruption while you look into the problem and resolve it as necessary. If you uncheck this option, your board will go on running, potentially corrupting very many files until you discover and fix the problem.

  • [ ] Disk quota checking: Disable file size verifications (not recommended): If you check this box, the quota checking as described in the previous section will not be performed. Checking this box greatly increases the possibilities of data corruption on your board.

  • [X] File Locking: Disable board if file locking does not work properly: If checked (recommended) and Discus detects that a permissions problem on your board is preventing file locking from working properly, the board will be disabled automatically. If you uncheck this option, you risk either your disk quota filling up needlessly from file lock attempts, or corruption due to failing file locking.

  • [ ] File Locking: Use directory-file-based locking (not recommended): Directory-file-based locking is the scheme used in Discus 3.10 for file locking. Rather than creating directories in the 'locks' directory, Discus creates files. However, files can be overwritten even if they exist, and it is slower for Discus to create the file and then read the file to make sure that the process number in that file matches the process of the creator. This should be used only if the default method of file locking does not work properly for some reason that cannot be overcome (DiscusWare has seen no such cases of this).

  • [ ] File Locking: Use file-based locking (not recommended): File-based locking is the scheme used in Discus 3.0 and before for file locking. In this scheme, one file that lists all file locks is kept. However, this file is often corrupted due to the same conditions that file locking is designed to prevent (simultaneous access to the file wipes out its content). This should be used only if neither the default method of file locking and the directory-file-based method of file locking work properly for some reason that cannot be overcome (DiscusWare has seen no such cases of this). If you check this box, crucial data files of your board will almost certainly be corrupted at some time.



Copyright © 2002, DiscusWare, LLC, all rights reserved