As many of you have noticed, running the 'ls' command on any directory in /scratch on the Helium cluster can be very slow. This is because the 'ls' command on Helium is an alias with the following definition: 'ls --color=tty'. This will provide nice color output for different file types. This is generally good for most file systems but not for Lustre, which is the type of file system that /scratch is. The reason for this is because in order to produce the colorized output the file type of every file in the directory must be determined. This causes a file stat operation to be done on each file, which forces the Lustre metadata server to query the object storage servers for each file. This is a very costly operation. When looking at directory listings in /scratch it is better to not use any operations that cause a file stat to have to be done on many files. Note that the '-l' flag to 'ls' will cause a file stat operation. If you need to know file sizes, then explicitly specify the ones you want rather than obtaining them for an entire directory.
For convenience, a new alias has been created on Helium:
The new alias will get picked up at your next login session. To activate it if you are already logged in, for each logged in session:
For Bash users: source /etc/profile
For (t)csh users: source /etc/csh.cshrc
Then when getting a directory listing in /scratch use the lls alias:
If you have any scripts that run in /scratch that call 'ls' it would be good if you could 'lls' instead.