[Samba] Windows 2K outperform Linux/Samba very much?

Jacky Kim jcy_2008 at 163.com
Sun Jul 11 07:30:01 GMT 2004


Thank Mark.

I have tried another test program in Linux, it call 2 C lib functions
(open & fstat) to small files, and I compute the time they take via
gettimeofday system call.

	// C code ... 
	ret = gettimeofday(&before, &zone);
	fd = open(argv[1], O_RDONLY);
	ret = gettimeofday(&after, &zone);
	interval1 = (after.tv_usec - before.tv_usec);
	ret = fstat(fd, &buf);
	ret = gettimeofday(&before, &zone);
	interval2 = (before.tv_usec - after.tv_usec);
	// C code ...

Linux Test results(time unit is usec):
	case      open      fstat
	----      ----      -----
	1         800       240
	1         757       239
	2         18175     245
	2         17240     246
Case 1: smbmount Linux/samba's share that contains 20,000 small files
        set 'case sensitive = Yes' in smb.conf   
Case 2: smbmount Windows's share that contains 20,000 small file

Test analysis:
1. Linux/samba performs much better than Windows as for open system call.
2. The 2 Operation systems have same performance with fstat system call.


But when VB test program in Windows is used, Windows has much better 
perpormance then linux/samba

	// VB code ...
	Set objFSO = CreateObject("Scripting.FileSystemObject")
	thistime = thisnow
	If objFSO.FileExists(fn) Then
		totle = totle & "Check file time " & CStr(thisnow - thistime) + " ms" + vbCrLf
		thistime = thisnow
		Set objFile = objFSO.GetFile(fn)
		totle = totle & "Get object time " & CStr(thisnow - thistime) + " ms" + vbCrLf
		thistime = thisnow
		temp = DateValue(CStr(objFile.DateLastModified))
		totle = totle & "Get date time " & CStr(thisnow - thistime) + " ms" + vbCrLf
	End If
	// VB code ...

Windows Test results(time unit is msec):
	case   FileExists  GetFile  DateLastModified
	----   ----------  -------  ----------------
	1         20       0        100
	1         0        0        120
	1         0        0        61
	2         30       10       0
	2         30       0        0
	2         10       0        0
Case 1: map Linux/samba's share that contains 20,000 small files
        set 'case sensitive = Yes' in smb.conf  
Case 2: map Windows's share that contains 20,000 small file


Can we get the follow conclusions as for check small file's property:
1. Windows client can get much better performance from Windows's share than others'
2. Linux client can get much better performance from Linux/Samba's share than others'

Best Regards!
Jacky Kim
.

>Hi,
>
>The next step is probably to capture some network traces of your
>benchmarking test and compare and contrast the NT and Samba backends.
>
>Playing with the negotiated protocol level might win you some more
>performance by simplifying the transactions.  It may lose you a lot too
>though.  (See max protocol option)
>
>There are the max xmit/socket options/stat cache tweakables.  If you
>have logging wound up on the linux box, that can affect performance
>greatly too.
>
>How does performance of the filesystem on the linux machine vary with
>number of files in the directory ?  Ie, take samba out of the equation
>and see if you're running into underlying issues with your file layout.
>
>Splitting your directory into a hierarchical structure is certainly more
>scalable than a flat directory.
>
>Mark
>





More information about the samba mailing list