Skip to main content
NetApp Knowledge Base

What directory structure should I use to avoid maxdirsize issues?

Views:
5,868
Visibility:
Public
Votes:
5
Category:
ontap-9
Specialty:
CORE
Last Updated:

 

Applies to

  • ONTAP 9
  • Cloud Volumes ONTAP
  • Data ONTAP 8
  • Maximum Directory size

Answer

The best way to reduce the performance effect in directories with large numbers of files is to spread files across more directories in the file system.

  • Newer platforms offer more memory and CPU capacity, and AFF systems provide performance benefits for high-file-count environments.
  • The maxdirsize value can be a concern when you are using flat directory structures, where a single folder contains millions of files at a single level.
  • Folder structures where files, folders, and subfolders are interspersed have a low impact on maxdirsize.
There are several directory structure methodologies
  • For the best performance, avoid flat directory structures in ONTAP if at all possible.
  • Wide or deep directory structures work best, as long as the path length of the file or folder does not exceed NAS protocol standards. 
Directory Structure Layout Recommended
Flat directory structure

A single directory with many files

maxdirsize issues maxdirsize issues
Wide directory structure

Many top-level directories with files spread across directories.

maxdirsize issues maxdirsize issues
Deep directory structure

Fewer top-level directories, but with many subfolders; files spread across directories.

maxdirsize issues maxdirsize issues
  • If flat directory structures are unavoidable, pay close attention to the maxdirsize values for the volume and increase them as necessary.
  • NFS path lengths are defined by the client OS.
  • For information about SMB path lengths, see this Microsoft Dev Center link.

 

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.