Am 07.11.18 um 12:07 schrieb Rowland Penny via samba:> On Wed, 7 Nov 2018 11:44:28 +0100 > Reindl Harald via samba <samba at lists.samba.org> wrote: > >> >> Am 07.11.18 um 09:54 schrieb Rowland Penny via samba: >>> On Wed, 7 Nov 2018 05:45:45 +0300 >>> Albert Berger via samba <samba at lists.samba.org> wrote: >>> >>>> I'm running a Samba server on Raspbian and observing that Samba >>>> during idle periods is constantly (every minute) writing to HDD >>>> (maybe doing some journaling?) what causes the HDD to constantly >>>> spin and never standby: >>>> >>>> root at rpi:~# pidstat -dl 20 >>>> Linux 4.4.50-v7+ (localhost) 11/07/2018 >>>> _armv7l_ (4 CPU) >>>> 04:10:08 AM UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay >>>> Command 04:10:28 AM 0 832 0.00 0.20 0.20 >>>> 0 /usr/sbin/smbd -D >>>> 04:11:08 AM UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay >>>> Command 04:11:28 AM 0 832 0.00 0.20 0.20 >>>> 0 /usr/sbin/smbd -D >>>> 04:12:08 AM UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay >>>> Command 04:12:28 AM 0 832 0.00 0.20 0.20 >>>> 0 /usr/sbin/smbd -D >>>> >>>> Is there some way (via configuration setting or maybe recompiling >>>> with some parameter) to turn off this constant disk io? >>>> >>> At first glance it looks like something is trying to write to a >>> share, but what is unclear from the info provided >> >> no, samba all day long writes to /var/lib/samba > > When Samba is idle it doesn't, Samba only writes when it does something. > > I have been running 'pidstat' on my computer for about 10 minutes now, > Samba is idle and guess what, none of the Samba deamons gets a mention.well, there are only connected 3 WinXP and 3 Win7 VM's with their personal folder on the sare, one has open MSIE with a website and all others doing nothing at all these VMs are stripped to the bare minimum becaus etheir only purpose is testing websites, no unused software or services installed or even running because the system is running on a micro-sd card iwas tempted more than once move "/var/lib/samba/private/msg.sock/" and "/var/lib/samba/lock/msg.lock/" in a tmpfs but that won't solve the issue 20K -rw-r--r-- 1 root root 20K 2018-11-07 12:16 printer_list.tdb 16K -rw-r--r-- 1 root root 16K 2018-11-07 12:16 serverid.tdb [root at nfs:~]$ backup-nfs.sh sending incremental file list sending incremental file list sending incremental file list sending incremental file list deleting samba/lock/msg.lock/1041903 deleting samba/private/msg.sock/1041903 samba/lock/gencache_notrans.tdb 454,656 100% 402.34MB/s 0:00:00 (xfr#1, to-chk=36/77) samba/lock/locking.tdb 491,520 100% 234.38MB/s 0:00:00 (xfr#2, to-chk=34/77) samba/lock/printer_list.tdb 20,480 100% 4.88MB/s 0:00:00 (xfr#3, to-chk=32/77) samba/lock/serverid.tdb 16,384 100% 3.91MB/s 0:00:00 (xfr#4, to-chk=31/77) samba/lock/smbXsrv_open_global.tdb 36,864 100% 8.79MB/s 0:00:00 (xfr#5, to-chk=29/77) samba/lock/msg.lock/ samba/private/msg.sock/ sending incremental file list
On Wed, 7 Nov 2018 12:21:17 +0100 Reindl Harald via samba <samba at lists.samba.org> wrote:> > > Am 07.11.18 um 12:07 schrieb Rowland Penny via samba: > > On Wed, 7 Nov 2018 11:44:28 +0100 > > Reindl Harald via samba <samba at lists.samba.org> wrote: > > > >> > >> Am 07.11.18 um 09:54 schrieb Rowland Penny via samba: > >>> On Wed, 7 Nov 2018 05:45:45 +0300 > >>> Albert Berger via samba <samba at lists.samba.org> wrote: > >>> > >>>> I'm running a Samba server on Raspbian and observing that Samba > >>>> during idle periods is constantly (every minute) writing to HDD > >>>> (maybe doing some journaling?) what causes the HDD to constantly > >>>> spin and never standby: > >>>> > >>>> root at rpi:~# pidstat -dl 20 > >>>> Linux 4.4.50-v7+ (localhost) 11/07/2018 > >>>> _armv7l_ (4 CPU) > >>>> 04:10:08 AM UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay > >>>> Command 04:10:28 AM 0 832 0.00 0.20 0.20 > >>>> 0 /usr/sbin/smbd -D > >>>> 04:11:08 AM UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay > >>>> Command 04:11:28 AM 0 832 0.00 0.20 0.20 > >>>> 0 /usr/sbin/smbd -D > >>>> 04:12:08 AM UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay > >>>> Command 04:12:28 AM 0 832 0.00 0.20 0.20 > >>>> 0 /usr/sbin/smbd -D > >>>> > >>>> Is there some way (via configuration setting or maybe recompiling > >>>> with some parameter) to turn off this constant disk io? > >>>> > >>> At first glance it looks like something is trying to write to a > >>> share, but what is unclear from the info provided > >> > >> no, samba all day long writes to /var/lib/samba > > > > When Samba is idle it doesn't, Samba only writes when it does > > something. > > > > I have been running 'pidstat' on my computer for about 10 minutes > > now, Samba is idle and guess what, none of the Samba deamons gets a > > mention. > > well, there are only connected 3 WinXP and 3 Win7 VM's with their > personal folder on the sare, one has open MSIE with a website and all > others doing nothing at all > > these VMs are stripped to the bare minimum becaus etheir only purpose > is testing websites, no unused software or services installed or even > running > > because the system is running on a micro-sd card iwas tempted more > than once move "/var/lib/samba/private/msg.sock/" and > "/var/lib/samba/lock/msg.lock/" in a tmpfs > > but that won't solve the issue > 20K -rw-r--r-- 1 root root 20K 2018-11-07 12:16 printer_list.tdb > 16K -rw-r--r-- 1 root root 16K 2018-11-07 12:16 serverid.tdb > > [root at nfs:~]$ backup-nfs.sh > sending incremental file list > sending incremental file list > sending incremental file list > sending incremental file list > deleting samba/lock/msg.lock/1041903 > deleting samba/private/msg.sock/1041903 > samba/lock/gencache_notrans.tdb > 454,656 100% 402.34MB/s 0:00:00 (xfr#1, to-chk=36/77) > samba/lock/locking.tdb > 491,520 100% 234.38MB/s 0:00:00 (xfr#2, to-chk=34/77) > samba/lock/printer_list.tdb > 20,480 100% 4.88MB/s 0:00:00 (xfr#3, to-chk=32/77) > samba/lock/serverid.tdb > 16,384 100% 3.91MB/s 0:00:00 (xfr#4, to-chk=31/77) > samba/lock/smbXsrv_open_global.tdb > 36,864 100% 8.79MB/s 0:00:00 (xfr#5, to-chk=29/77) > samba/lock/msg.lock/ > samba/private/msg.sock/ > sending incremental file list >Reindl, you are not helping, nothing you have posted seems to have anything to do with the OP's problem and my 'pidstat' is still running without mention of smbd, nmbd or winbind. Rowland
On Wed, 2018-11-07 at 12:21 +0100, Reindl Harald via samba wrote:> > > well, there are only connected 3 WinXP and 3 Win7 VM's with their > personal folder on the sare, one has open MSIE with a website and all > others doing nothing at all > > these VMs are stripped to the bare minimum becaus etheir only purpose > is > testing websites, no unused software or services installed or even > running > > because the system is running on a micro-sd card iwas tempted more > than > once move "/var/lib/samba/private/msg.sock/" and > "/var/lib/samba/lock/msg.lock/" in a tmpfs > > but that won't solve the issue > 20K -rw-r--r-- 1 root root 20K 2018-11-07 12:16 printer_list.tdb > 16K -rw-r--r-- 1 root root 16K 2018-11-07 12:16 serverid.tdb > > [root at nfs:~]$ backup-nfs.sh > sending incremental file list > sending incremental file list > sending incremental file list > sending incremental file list > deleting samba/lock/msg.lock/1041903 > deleting samba/private/msg.sock/1041903 > samba/lock/gencache_notrans.tdb > 454,656 100% 402.34MB/s 0:00:00 (xfr#1, to-chk=36/77) > samba/lock/locking.tdb > 491,520 100% 234.38MB/s 0:00:00 (xfr#2, to-chk=34/77) > samba/lock/printer_list.tdb > 20,480 100% 4.88MB/s 0:00:00 (xfr#3, to-chk=32/77) > samba/lock/serverid.tdb > 16,384 100% 3.91MB/s 0:00:00 (xfr#4, to-chk=31/77) > samba/lock/smbXsrv_open_global.tdb > 36,864 100% 8.79MB/s 0:00:00 (xfr#5, to-chk=29/77) > samba/lock/msg.lock/ > samba/private/msg.sock/ > sending incremental file listI think you are onto something here. Certainly there is a very good argument for putting 'lock dir' on a tmpfs and it would be worth asking Volker why msg.sock didn't go under 'lock dir' as it would seem to meet that definition (they certainly make no sense after a reboot). Andrew Bartlett -- Andrew Bartlett http://samba.org/~abartlet/ Authentication Developer, Samba Team http://samba.org Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba
On Wed, Nov 07, 2018 at 12:21:17PM +0100, Reindl Harald via samba wrote:> > well, there are only connected 3 WinXP and 3 Win7 VM's with their > personal folder on the sare, one has open MSIE with a website and all > others doing nothing at all > > these VMs are stripped to the bare minimum becaus etheir only purpose is > testing websites, no unused software or services installed or even running > > because the system is running on a micro-sd card iwas tempted more than > once move "/var/lib/samba/private/msg.sock/" and > "/var/lib/samba/lock/msg.lock/" in a tmpfs > > but that won't solve the issue > 20K -rw-r--r-- 1 root root 20K 2018-11-07 12:16 printer_list.tdb > 16K -rw-r--r-- 1 root root 16K 2018-11-07 12:16 serverid.tdb > > [root at nfs:~]$ backup-nfs.sh > sending incremental file list > sending incremental file list > sending incremental file list > sending incremental file list > deleting samba/lock/msg.lock/1041903 > deleting samba/private/msg.sock/1041903 > samba/lock/gencache_notrans.tdb > 454,656 100% 402.34MB/s 0:00:00 (xfr#1, to-chk=36/77) > samba/lock/locking.tdb > 491,520 100% 234.38MB/s 0:00:00 (xfr#2, to-chk=34/77) > samba/lock/printer_list.tdb > 20,480 100% 4.88MB/s 0:00:00 (xfr#3, to-chk=32/77) > samba/lock/serverid.tdb > 16,384 100% 3.91MB/s 0:00:00 (xfr#4, to-chk=31/77) > samba/lock/smbXsrv_open_global.tdb > 36,864 100% 8.79MB/s 0:00:00 (xfr#5, to-chk=29/77) > samba/lock/msg.lock/ > samba/private/msg.sock/ > sending incremental file listCan you do an strace on the processes that may be causing the access. I'd like to see what system call they're making.
On Thu, Nov 08, 2018 at 06:12:40AM +1300, Andrew Bartlett wrote:> On Wed, 2018-11-07 at 15:19 +0300, Albert Berger via samba wrote: > > > > I tried in sequence to start Samba in following conditions: > > > > 1. With all clients disconnected from Samba server; > > 2. As above + all shares disabled; > > 3. As above + minimal smb.conf > > 4. With totally empty smb.conf. > > > > In all cases those every-60-seconds writes persist. > > What else can be done in this situation? Can it be > > that some Debian/Raspbian patch causes this behaviour? > > Should I try to compile Samba from upstream? > > You haven't said what version you are running. > > But in general, there are essentially no specific Debian patches, we > work hard to keep those packages as upstream as possible, so unless > Raspbian has done something really odd (unlikely) there isn't any point > going upstream. > > Andrew Bartlett > -- > Andrew Bartlett http://samba.org/~abartlet/ > Authentication Developer, Samba Team http://samba.org > Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba >Well, I mentioned that the output of "smbd --version" is "4.2.14-Debian". Is this the package version? In Samba's source code there are mentions of "housekeeping" activity: in the file process.c one can search for SMBD_HOUSEKEEPING_INTERVAL and 'housekeeping_fn' which among other things performs some operations with log files. Can this be the explanation? /Al