Best practices for File Store
This guide covers best practices for organizing files, optimizing performance, and managing File Store effectively.
File organization
- 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.
- Use meaningful hierarchies: Organize files in a logical directory structure
- Limit files per directory: Keep directories under 10,000 entries for best performance
Client connections
- 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 - Reuse connections – Mount once and keep connections open rather than repeatedly mounting and unmounting
- Same-zone access – VMs and File Stores must be in the same zone. Cross-zone access is not supported.
Naming conventions
- Keep filenames under 255 bytes: This is the maximum filename length
- Use reasonable path lengths: Keep total paths under 4,096 bytes
- 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
- File Store can only be accessed from VMs in the same zone — cross-zone access is not supported
- If you need dedicated storage in multiple zones, create a File Store in each zone
- Distribute workloads across zones for resilience
See Also
- File Store concepts - Understanding the service
- Configure mount options - Optimize mount settings
- Mount on multiple VMs - Shared access patterns