- Table of Contents
- Copyright
- About the Lead Authors
- About the Contributing Authors
- Acknowledgments
- Tell Us What You Think!
- Introduction
- I. Red Hat Linux Installation and User Services
- Chapter 1. Introduction to Red Hat Linux
- Chapter 2. Installation of Your Red Hat System
- Chapter 3. LILO and Other Boot Managers
- Chapter 4. Configuring the X Window System, Version 11
- Chapter 5. Window Managers
- Chapter 6. Connecting to the Internet
- Chapter 7. IRC, ICQ, and Chat Clients
- Chapter 8. Using Multimedia and Graphics Clients
- II. Configuring Services
- Chapter 9. System Startup and Shutdown
- Chapter 10. SMTP and Protocols
- Chapter 11. FTP
- Chapter 12. Apache Server
- Chapter 13. Internet News
- Chapter 14. Domain Name Service and Dynamic Host Configuration Protocol
- Chapter 15. NIS: Network Information Service
- Chapter 16. NFS: Network Filesystem
- Chapter 17. Samba
- Installing Samba
- Getting a Simple Samba Setup Running
- Configuring Samba
- Configuring a Samba File Server with linuxconf
- Sharing Files and Print Services
- Optimizing Samba Performance
- Testing Your Configuration
- Running the Samba Server
- Accessing Shares
- Common smb.conf Options
- Samba Resources
- Using Samba as a Logon Server
- Samba Troubleshooting Tips
- Samba Security
- Using SWAT for Web-Based Samba Configuration
- Using Samba as a Linux Migration Tool
- Summary
- III. System Administration and Management
- Chapter 18. Linux Filesystems, Disks, and Other Devices
- Chapter 19. Printing with Linux
- Chapter 20. TCP/IP Network Management
- Chapter 21. Linux System Administration
- Chapter 22. Backup and Restore
- Chapter 23. System Security
- IV. Red Hat Development and Productivity
- Chapter 24. Linux C/C++ Programming Tools
- Chapter 25. Shell Scripting
- Chapter 26. Automating Tasks
- Chapter 27. Configuring and Building Kernels
- Chapter 28. Emulators, Tools, and Window Clients
- V. Appendixes
- A. The Linux Documentation Project
- B. Top Linux Commands and Utilities
- C. The GNU General Public License
- D. Red Hat Linux RPM Package Listings
Optimizing Samba Performance
Samba performs excellently, so performance usually isn't an issue. If performance becomes an issue, there are several options to evaluate.
Samba's defaults yield excellent performance. However, the Samba 2.0.7 default is level2 oplocks=no. You can substantially boost performance of a share whose primary file access is read, and that has little write contention, by setting it to yes.
Level 2 oplocks are an opportunistic locking mechanism enabling the file to be cached, for read access, on the client. This greatly decreases traffic over the wire. However, if even one client requests write access for the file, all the clients must reread the file.
Make sure to retain the default oplocks=yes unless files are edited directly on the UNIX box, in which case the client caching would result in a versioning problem. You should also turn off oplocks on unstable networks, but most Linux/Samba served networks are extremely stable.
Modern Samba versions, including the one shipped with Red Hat 7, default to wide links=yes. It is slightly more secure to set this to no, but setting it to no creates a substantial performance decrease. To minimize that decrease, be sure that getwd cache=yes, which is already the default. The combination of wide links=no and getwd cache=no significantly reduces performance.
Last but not least, the smb.conf shipping with Red Hat 7 contains the following parameter:
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
Unless you have a specific reason to do otherwise, the preceding should be the setting of the socket options= parameter on Red Hat 7 Samba servers.
Tweaks to virtual memory utilization may also improve Samba performance by tuning Linux to optimally handle Samba. Two tweaks specifically have been documented.
# echo "80 500 64 64 80 6000 6000 1884 2" >/proc/sys/vm/bdflush # echo "60 80 80" >/proc/sys/vm/buffermem
Some other possible enhancement techniques include faster network hardware and wiring, a better server hard disk, more server memory, or a server CPU upgrade.
The bottom line is that performance is bottleneck-limited, so to improve performance, it's essential to locate the performance bottleneck. A performance enhancement plan can be made once that's done. Until the bottleneck is located, speculation makes little sense.
One of the best bottleneck analysis techniques is deliberately slowing a suspected bottleneck. If system throughput slows proportionately, you've found a bottleneck. If system throughput slows only slightly, continue looking.
Testing Your Configuration | Next Section

Account Sign In
View your cart