Best practices for File Store

This guide covers best practices for organizing files, optimizing performance, and managing File Store effectively.

File organization

  1. Distribute files across directories: Avoid putting all files in a single directory. While the service supports up to 64,000 entries per directory, performance degrades with larger directories.
  2. Use meaningful hierarchies: Organize files in a logical directory structure
  3. Limit files per directory: Keep directories under 10,000 entries for best performance

Client connections

  1. Use the recommended mount options – Mount with options optimized for File Store:
    sudo mount -t nfs4 -o nfsvers=4.1,_netdev,nconnect=16,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 \
      <endpoint>:/ /mnt/filestore
    
  2. Reuse connections – Mount once and keep connections open rather than repeatedly mounting and unmounting
  3. Same-zone access – Keep VMs and File Stores in the same zone for best performance. Cross-zone access may experience higher latency.

Naming conventions

  1. Keep filenames under 255 bytes: This is the maximum filename length
  2. Use reasonable path lengths: Keep total paths under 4,096 bytes
  3. Avoid special characters: Stick to alphanumeric characters, hyphens, and underscores

Zone placement

  • For best performance, create File Stores in the same zone as the VMs that'll access them
  • Cross-zone access within the same region is possible, but may experience higher latency
  • If you need dedicated storage in multiple zones, create a File Store in each zone
  • Distribute workloads across zones for resilience

See Also