[Samba] Possible Issue with Samba Blocking I/O and CPU

Andy Liebman andyliebman at aol.com
Fri Jun 11 06:01:58 MDT 2010

> According to Jeremy, using "write cache size = 262144", you end up with a 256
> _megabyte_ cache for _each_ smbd process.  Apparently the setting value is in
> kilobytes, not bytes.  With 10 active users that equals ~2.5GB of system
> (virtual) memory allocated to smbd read/write cache.  This would definitely
> explain why you're masking any underlying kernel I/O problem.  As Jeremy said,
> with this configuration, you're now rarely touching the disks.
Hi Stan,

This contradicts what it says in "man smb.conf".   Can we clarify what 
is correct?

      write cache size (S)

    If this integer parameter is set to non-zero value, Samba will
    create an in-memory cache for each oplocked file (it does /not/ do
    this for non-oplocked files). All writes that the client does not
    request to be flushed directly to disk will be stored in this cache
    if possible. The cache is flushed onto disk when a write comes in
    whose offset would not fit into the cache or when the file is closed
    by the client. Reads for the file are also served from this cache if
    the data is stored within it.

    This cache allows Samba to batch client writes into a more efficient
    write size for RAID disks (i.e. writes may be tuned to be the RAID
    stripe size) and can improve performance on systems where the disk
    subsystem is a bottleneck but there is free memory for userspace

    The integer parameter specifies the size of this cache (per oplocked
    file) in bytes.

    Default: //|write cache size|/ = |0| /

    Example: //|write cache size|/ = |262144 # for a 256k cache size per
    file| /

More information about the samba mailing list