David Hallberg

Deleting Old Files

Today’s topic is an issue over which Millennium users disagree: whether the number of files in a directory or filesystem impacts the Operating System (OS). Many of you say no, but I believe it does. Having too many files in a directory or filesystem with no scheduled purging of those filesystems will degrade your system’s performance.

Those who state that the number of files has no impact on the OS begin with a great assumption: that Millennium was written by the OS vendor and that it is compiled for the OS version it is running on. Those versions include 64-bit for VMS, AIX and Linux and 48-bit for HP-UX. Unfortunately, the Millennium application is written with the 32-bit compilers for each of these platforms. Under ideal situations, the OS may not care about how many files exist, so long as there is free disk space, but Millennium does. The number of files affects CCL report generation to either your Millennium session or a printer and definitely affects the primary Millennium print servers, such as DCP Output (SCP 106), System Print Server (Node Specific) (SCP 127), Print Services Cache Manager Server (SCP 128) and System Print Server (SCP 129).

Let me give you an example. The SysSrvPrint error message from the servers indicates that the Millennium executable cannot find the file in the filesystem. This event can happen because 1) the file is on another node, 2) the file was purged before it was printed, or 3) it took too long for the executable to look up the file. That third failure reason is easy to prevent. If you delete files from the $cer_print and $CCLSCRATCH directories every four to six hours, you should be in good shape.

You can count how many files are in the $cer_print directory or filesystem using this command (the last character is a lowercase L):

ls $cer_print | wc -l

Likewise, to see a count of the files in the $CCLSCRATCH directory, type the command:

ls $CCLSCRATCH | wc -l

The goal for optimal performance within all Millennium solutions is to have less than 5,000 files in any of these directories at any point in time. Due to the number of facilities and solutions you have and the Millennium version you use, you might not always be able to achieve this level. But I encourage you to keep working towards it.

The crontab job scheduler in the $cer_proc directory comes with a UNIX Korn shell (ksh) named clean_wh_env.ksh that deletes unnecessary files. The ksh will probably have to be tweaked to fit your specific site. This takes a little getting used to if you are unfamiliar with UNIX scripting but will greatly improve Millennium’s speed and reliability. Beginning from the directory count you ran from the commands listed above, identify the directory that contains the greatest amount of files and then modify the clean_wh_env.ksh file either 1) to be run more frequently from crontab or 2) to delete additional file patterns or extensions.

The ksh should also be used to clean up the following additional filesystems: $cer_temp, $cer_log, $cer_usock, $cer_fifo, $cer_lock and $CCLUSERDIR. Access the file count in these directories with the command listed above. For these directories, deletions scheduled to run once a day should be enough.

Prognosis: Using your Operating System’s scheduling service to routinely delete unneeded files from your filesystems will increase Millennium’s speed and reliability