Network and Storage Protocols

How does SMB Credits actually work on ONTAP

OliverD
8,997 Views

Dear Community,

 

Since ONTAP 9.4 [1] there is this new CIFS option "-max-credits" with a default of 128.

According to Microsoft [2] on Windows Servers this defaults to 8192.

 

The basic of SMB Credits as far as I know is, the server grants the client x-amount of credits, which the client can spend for requests to the server. By limiting the credits it should be possible to cap rouge clients. But how does this work?

 

What does the configured credit amount actually mean? 

Is this for a specific timeframe? Is the amount for each client or for the whole Server?

Will the server grant the credits on client request? What does affect the grant of these credits?

How can this be monitored?

How to find out, if the configured max-credits are too high or too low?

Why has MS set the default to 8192 and NetApp only to 128?

 

Best regards

Oliver

 

[1] http://docs.netapp.com/ontap-9/index.jsp?topic=%2Fcom.netapp.doc.cdot-famg-cifs%2FGUID-EC0BFDD6-C1BC-4673-96AB-94D765FE762A.html&resultof=%22-max-cred... 

[2] https://docs.microsoft.com/en-us/windows-server/administration/performance-tuning/role/file-server/smb-file-server

2 REPLIES 2

Ontapforrum
8,972 Views

Hi,

 

It's a interesting one, I have never tweaked this value, perhaps I didn't even know that it could be useful in certain performance related instances.

 

From NetApp & MS KBs, I see that similar option was available in SMB_1 as well (max sessions per tcp connection) and in SMB_2, the word 'credit' is coined.

 

credit: A value that is granted to an SMB 2 Protocol client by an SMB_2 Protocol server that limits the number of outstanding requests that a client can send to a server.

 

For SMB_2 : -max-credit
For SMB_1 : cifs.max_mpx

 

The only logic that I can come up with in respect to different 'default' values is : SMB_2 for Microsoft is a native implementation, and therefore the number they have come up with is wrt to their Windows Server platform. Any 3-party implementation of SMB_2 such as NetApp, EMC, IBM etc would probably need to keep it low, as it is not just a single protocol dedicated box and therefore it may be advisable to start low ? I am sure this value grabs resources on both client & server side.

 

It's just my theory, I am curious to know more on this.

 

Thanks!

Ontapforrum
8,955 Views

Interestingly, on the samba.org, the definitions for both are  same:
https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html

 

smb2 max credits:
This option controls the maximum number of outstanding simultaneous SMB2 operations that Samba tells the client it will allow. This is similar to the max mux parameter for SMB1. You should never need to set this parameter.

 

The default is 8192 credits, which is the same as a Windows 2008R2 SMB2 server.
Default: smb2 max credits = 8192

NetApp equivalent : -max-credit

 

smb1 max mux:
This option controls the maximum number of outstanding simultaneous SMB operations that Samba tells the client it will allow. You should never need to set this parameter.
Default: max mux = 50

NetApp equivalent : cifs.max_mpx

Public