Operating System - Linux
1826372 Members
3455 Online
109692 Solutions
New Discussion

Re: How often does Samba write to disk?

 
TJ_22
Occasional Advisor

How often does Samba write to disk?

samba-3.0.7-1.3E.1

Does anyone know how often samba sync's itself with the disk?
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: How often does Samba write to disk?

Any time Samba has to write it tries. That means when it has write requests.

There are several factors that can delay writes, which include system wait i/o as in other write requests inline ahead of Samba.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
TJ_22
Occasional Advisor

Re: How often does Samba write to disk?

what about the "sync always" command which causes Samba to flush every write to disk? What happens when this isn't on? Is it held in a cache and then wrtiien to disk every so often?

Thanks,

T.J.
Gopi Sekar
Honored Contributor

Re: How often does Samba write to disk?

sync always ensures that samba writes the data to the disk before every write request gets completed.

otherwise in general, any application which wants to write data to hard disk simply gives the data to the kernel and the linux kernel will decide apprpriate time (based on CPU idle time, hard disk I/O performance, cache buffer) to write the data actually in to the disk.

enabling sync always has its own advantage and disadvantage:

adv: your data is always written to the hard disk, incase of powerfailure and machine goes down abruptly also your last second data is written to the hard disk.

dis-adv: server response goes very badly because it has to write the data back to the disk (which is very much slower than the CPU) every time and until the data is written the server will not respond back to the client.

Hope this helps,
Gopi
Never Never Never Giveup