Welcome to the world of Unraid, where the convenience of storage meets the complexities of optimization. If you’re looking to get the most out of your SMB (Server Message Block) shares on Unraid, you’ve come to the right place. This blog post dives into the depths of Unraid’s SMB shares, providing tips and tricks to optimize your network storage performance. So buckle up, and let’s enhance your Unraid experience!
Understanding SMB Shares in Unraid
Unraid, a powerful NAS (Network Attached Storage) solution, uses SMB protocol for file sharing across Windows networks. While user-friendly, SMB shares can sometimes underperform. The good news? There are ways to boost their efficiency.
Direct Disk Shares vs. User Shares
In Unraid, you have two options: using user shares (shared folders across multiple disks) or direct disk shares (accessing individual disks). Direct disk shares can be faster because they bypass some of the overhead associated with user shares. This can be especially noticeable when transferring large files or using high-speed networks like 10 Gigabit Ethernet.
Copying directly to a cache share rather than a user share can significantly improve transfer speeds, often allowing you to fully utilize your 10GbE link.
Tweaking Windows NIC Settings
On the Windows side, tweaking the NIC (Network Interface Card) settings can lead to performance gains. Disabling interrupt moderation on the NIC can resolve speed issues, as it allows the NIC to handle packets more efficiently.
Adjusting Interrupt Coalescing
In Unraid, adjusting interrupt coalescing settings can significantly impact performance. The
ethtool command is your friend here. By increasing
rx-usecs, you can optimize how your Unraid server handles incoming packets.
ethtool -C eth0 rx-usecs 200
Exploring Advanced Network Settings
Jumbo frames increase the amount of data that can be sent in a single packet, reducing overhead. However, ensure all devices on your network support jumbo frames, or you risk communication issues.
Cache Drive Considerations
Switching your cache drive to a more efficient filesystem like ZFS may also offer performance benefits, especially when dealing with large file transfers.
Enhancing SMB Throughput on Windows
Hosts File Trick
If you require more connections, try adding multiple entries in the Windows hosts file. This can help distribute the load and potentially increase throughput.
How to Edit the Hosts File:
- Press Win+R.
notepad c:\windows\system32\drivers\etc\hostsand press Enter.
- Add entries like `10.0.0.2 tower2
Enabling Disk Shares
For advanced users, enabling disk shares can be a game-changer. This allows direct access to array and cache disks as SMB shares. However, ensure you set proper access permissions in the Unraid WebGUI to maintain security. Remember, with great power comes great responsibility!
Network and Hardware Adjustments
If feasible, consider a direct connection to the Unraid server, bypassing potential network bottlenecks.
Antivirus and Firewall
Sometimes, the culprit behind slow speeds is antivirus or firewall software. Temporarily disabling these can help identify if they’re the issue.
Layer 3 Switches and VLANs
Using a layer 3 switch? Adding a VLAN other than the default VLAN 1 can allow for higher jumbo frame sizes, optimizing performance.
Advanced Unraid Settings
Enabling Turbo Writes
Turbo writes can significantly boost write speeds to the array by writing directly to the parity disk, reducing write amplification.
Enabling SMB Multichannel can distribute network traffic across multiple network interfaces, potentially boosting performance.
- Open Unraid Webterminal.
server multi channel support = yes.
- Save and restart Samba service:
Performance Testing and Fine-Tuning
Run Network Tests
Use tools like iperf to test network performance. Ensure you’re using compatible versions for accurate results.
Update NIC Drivers
Outdated drivers can hinder performance. Make sure you’re using the latest drivers from the vendor’s site.
Optimize NIC Settings
- Enable RSS queues.
- Disable power-saving features and set the power plan to performance.
- Disable interrupt moderation.
- Enable jumbo frames on all network devices.
- Ensure TCP Window auto-tuning is set to normal.
- Plug the NIC into at least a PCIe 8X slot.
- Enable offload features.
In Unraid 6.12, you could essentially create additional arrays that have redundancy. With Raidz levels, you can determine how many drive failures you can have. And with “exclusive shares” mode, you bypass the FUSE layer which, in my case, more than doubled the transfer speeds. The drawbacks is of course requiring the same size drives (or it’ll just take the smallest one), and a certain minimum number of drives when you want to expand the pool. The traditional Unraid array shines in regards to flexibility with different size drives and expansions.
But one beautiful thing about ZFS is how it prevents bit rot. ZFS (Zettabyte File System) is renowned for its ability to prevent and correct bit rot, a phenomenon where bits of data on a storage medium spontaneously change over time, leading to data corruption. This capability is one of ZFS’s most lauded features, and it’s achieved through a combination of several sophisticated mechanisms:
1. Checksums for Data Integrity
- How It Works: Every block of data written in ZFS has a checksum value associated with it. This checksum is stored separately from the data block, typically in the block’s pointer in the dataset’s metadata.
- Functionality: When a block of data is read, ZFS recalculates its checksum and compares it to the stored checksum. If they don’t match, it means the data has been corrupted (bit rot).
- Detection: This process allows ZFS to detect corruption anywhere within the file system, including in the file data and associated metadata.
2. Copy-on-Write (CoW) Transactional Model
- Principle: ZFS employs a Copy-on-Write model. When data is changed, it’s written to a new block, and only after the write is complete and verified does ZFS update the pointer to this new block.
- Data Protection: This method ensures that data corruption can’t occur during a write operation, as the original data remains unaltered until the new, verified data is securely in place.
3. Self-Healing Data
- Redundancy: ZFS can be configured with redundancy (like RAIDZ, the ZFS equivalent of RAID), which means it stores extra copies of data either across multiple disks or as mirrored pairs.
- Correction Process: When a checksum mismatch is detected, indicating potential bit rot, ZFS uses the redundant copies to identify the correct data. It automatically replaces the corrupted data with a correct copy from one of the redundant sources.
- Result: This self-healing process ensures that data remains consistent and free from corruption over time.
- Proactive Checking: ZFS supports a process known as “scrubbing,” where it proactively checks every block of data in the storage pool against its checksum.
- Periodic Maintenance: Regular scrubbing can detect and correct bit rot that hasn’t been caught through regular read operations, making it a key tool in maintaining data integrity over long periods.
5. Snapshot and Cloning Features
- Immutable Snapshots: ZFS can create read-only snapshots of data states at given points in time. These snapshots are immutable, meaning they don’t change even if the current state of the data does.
- Cloning and Rollbacks: If corruption is detected, administrators can roll back to a previous snapshot before the corruption occurred. While this doesn’t prevent bit rot, it’s a powerful tool for data recovery.
Final Thoughts: Balancing Performance and Usability
Optimizing SMB shares on Unraid can be a balance between performance gains and maintaining a user-friendly environment. Always consider the trade-offs and test thoroughly to find the sweet spot for your specific setup.
Remember, technology is a constantly moving target, and what works today might need tweaking tomorrow. Stay curious, stay informed, and enjoy the journey of optimizing your Unraid server!