Skip to main content

filesystems tuning

File system tuning optimizes storage performance by adjusting settings like block size, caching, journaling, and I/O methods (sync/async) to match workloads, improving speed, throughput, and resource use for specific tasks, crucial for servers running databases or virtual machines. Key techniques involve optimizing disk hardware, tuning buffer sizes (like numfsbufs), leveraging read-ahead/write-behind, using Direct I/O, and applying system profiles via tools like tuned-adm for Linux, all aiming to reduce bottlenecks and enhance efficiency. 

Core Concepts & Parameters
  • I/O Operations: Tuning reads/writes, utilizing asynchronous I/O (AIO) to prevent application blocking, and optimizing read-ahead for sequential access.
  • Block Size: Affects data efficiency; larger blocks can speed up large file transfers, while smaller ones suit many small files.
  • Caching & Buffers: Increasing file system buffers (numfsbufs) can help with heavy I/O; faster RAM disks for /tmp also boost performance.
  • Journaling: Balancing the performance impact of logging changes for data integrity (e.g., using commit options).
  • File System Type: Different file systems (Ext4, XFS, NTFS) have unique strengths; tuning depends on the chosen one. 

Key Tuning Techniques
  • Hardware Optimization: Ensure disk controllers use fast DMA modes.
  • Read-Ahead/Write-Behind: Boost sequential read/write performance by pre-fetching/delaying writes.
  • Direct I/O (DIO): Bypasses the kernel's file cache to reduce CPU load and data copies for specific applications.
  • Tuning Profiles (Linux): Use tuned-adm to apply profiles (e.g., throughput-performancevirtual-guest) for workload-specific settings.
  • Application-Level: Design apps to gather large data chunks and write them sequentially. 

How to Approach Tuning
  1. Monitor: Identify bottlenecks using tools like vmstat -v or iostat.
  2. Select: Choose parameters relevant to your workload (e.g., database needs high I/O, web server needs low latency).
  3. Apply: Use commands like mkfs (for creation), mount options, or tuned-adm to change settings.
  4. Test: Verify improvements with performance benchmarks.