[THIN] Re: SMB Current Commands and SMB tuning

  • From: Berny Stapleton <berny@xxxxxxxxxxxxxxxxx>
  • To: thin@xxxxxxxxxxxxx
  • Date: Wed, 17 Nov 2010 07:28:02 +0000

MaxCmds is the amount of outstanding commands that the CIFS server can have
outstanding (Commands issued to it, but not serviced) before it starts
refusing commands (Requests). We have a single process whick looks for a
file in a list of folders about 20x / sec, this generates 150+ commands per
second and we have had to up our MaxCmds recently to account for this.

The counter that you see below would also include connections to itself
(IPC$).

Berny

On Tue, Nov 16, 2010 at 11:52 PM, Dan Dill <DanD@xxxxxxxxxx> wrote:

> So those stats were pulled during the afternoon at peak load (which is
> light for our servers, around 20-25 sessions).  I kept an eye on it over the
> course of an hour or two and saw that same pattern, flat with a couple of
> slight changes.
>
>
>
> I do appreciate those links, I did read through those before sending the
> email to the list and agree that those have are good resources.
>
>
>
> I did some testing last night on a Citrix server without MaxCmds set in the
> hops of understanding exactly how it works under the hood.  The citrix
> blog article on SMB 
> tuning<http://community.citrix.com/display/ocb/2010/10/21/SMB+Tuning+for+XenApp+and+File+Servers+on+Windows+Server+2008>seemed
>  to suggest ‘current commands’ = smb mpx limit which didn’t seem to be
> the case in my environment.
>
>
>
> On to the late night very unofficial test: Citrix is hitting CIFS on a
> Netapp array with MPX set to 126 so the session was established with the
> default 50 limit (from the client).  Off the start it seemed to take up 2
> ‘commands’ just from a user being logged in.  With 50+ directories opened in
> windows explorer it seemed to take up a “current command” for each folder
> opened, until around 50 after which is seemed to be re-using slots or
> something.  It didn’t scale up linearly from that point.  Opening 50+
> individual files used just one more ‘command’ on the server.  So 50 files =
> 3 commands, 50 directories = 52 commands.  I tested 50 files both in the
> same directories and each in its own directory (yay for powershell).  I
> never did hit a point where a file or folder open request failed, though I
> only tested up to about 75 of each.
>
>
>
> After tuning the server (MaxCmds), opening more than 50 folders resulted in
> a ‘command’ for each folder, scaling linearly.
>
>
>
> So my *guess* is that connections to folders and files are counted in that
> perfmon counter but that when it hits the negotiated limit the server begins
> to re-use or scavenge connections which can cause performance problems.  I
> wonder if this would only be a hard limit if your MaxCmds was less than the
> number of sessions (or users?) on the given machine perhaps?  Or perhaps
> it’s only a problem when 50 files are opened at a given time from that
> machine and not 50 folders?
>
>
>
> So unfortunately I didn’t satisfy my question of what *exactly* that
> counter is a reflection of and how that relates to MaxCmds.  I’m just going
> to roll that setting across the Citrix farm even though I’m not so sure it
> will provide any benefit or in what circumstances it would provide benefit.
> So maybe this was a snipe hunt, maybe not.
>
>
>
> Andrew I fully realize the possibility of there being a problem with this
> and it not being reported.  It’s also possible that this isn’t a problem and
> changing these settings will make no difference in my environment and I’m
> just wasting my time.  It’s better to err on the side of performance and
> since this is quite mainstream the changes will be made.
>
>
>
> Thanks for the help everyone.
>
>
>
>
>
> *Dan Dill** *|*Systems Engineer* | *Harsch Investment Properties*
>
>
>
> *From:* thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] *On
> Behalf Of *Andrew Wood
> *Sent:* Tuesday, November 16, 2010 12:03 AM
>
> *To:* thin@xxxxxxxxxxxxx
> *Subject:* [THIN] Re: SMB Current Commands and SMB tuning
>
>
>
> Joe’s figures are the ones recommended – bear in mind you need to change
> the file servers as well
>
>
>
> To answer your question Dan, perhaps your servers are fairly flat because
> the SMB commands were relatively constant when you did the test and by the
> looks of it, operating relatively well. When did you do the test? During the
> day? First thing in the morning? At the end of the day? Mid afternoon? If
> you were to set off some big file copies on a server – does the number go
> up? If you tune the values on the TS servers and the file servers, does the
> file copy take less time?
>
>
>
> What are those perfmon values on your file servers/domain controllers? What
> is the maxmpxct value on the file servers those citrix servers communicate
> with?
>
>
>
> “I’ve got an un-tuned server that hit 57 today without any reported issues”
> – its possible you did have a problem, it slowed for a second or two, or
> wasn’t as responsive as it could have been. “No Issues” often equals “no one
> said anything to me” – Maybe no one would have reported it because, unless
> it was prolonged, or regular, or stopped your CEO from checking Facebook few
> would raise a helpdesk call along the lines of “5 minutes ago the citrix
> server paused for a second or two, but its ok, it got better”
>
>
>
> This is a great article to read – which details SMB tuning across Windows
> 2003 x32/x64->windows2008R2
>
>
>
>
> http://community.citrix.com/display/ocb/2010/10/21/SMB+Tuning+for+XenApp+and+File+Servers+on+Windows+Server+2008
>
>
>
> A.
>
>
>
> *From:* thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] *On
> Behalf Of *Joe Shonk
> *Sent:* 16 November 2010 05:01
> *To:* thin@xxxxxxxxxxxxx
> *Subject:* [THIN] Re: SMB Current Commands and SMB tuning
>
>
>
> Here are the recommended settings from Microsoft: (
> http://support.microsoft.com/kb/324446)
>
>
>
> Microsoft Recommended Optimization Settings for Terminal Service
>
>                 MaxWorkItems = 8196
>
>                 MaxMpxCt = 2048
>
>                 MaxRawWorkItems = 512
>
>                 MaxFreeConnections = 100
>
>                 MinFreeConnections = 32
>
>
>
>                 MaxCmds = 2048
>
>                 RegistryLazyFlushInterval = 60
>
>
>
>                 PoolUsageMaximum=60
>
>                 PagedPoolSize=4294967295
>
>
>
> *From:* thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx] *On
> Behalf Of *Dan Dill
> *Sent:* Monday, November 15, 2010 6:11 PM
> *To:* thin@xxxxxxxxxxxxx
> *Subject:* [THIN] SMB Current Commands and SMB tuning
>
>
>
> Hello,
>
>
>
> I’ve been digging into SMB tuning for our PS 4.5 Server 2003 x64 citrix
> farm as our farm currently doesn’t have MaxMpxCt or MaxCmds set on our
> servers.  I am confused by the results of the Redirector\Current Commands
> output in perfmon.  That counter is defined as: “counts the number of
> requests to the Redirector that are currently queued for service” however
> the graph over time is quite flat when I could expect a queue graph to look
> spikey.  Is that counter a combination of the outstanding SMB requests *
> plus* something else?
>
>
>
> I’ve got an un-tuned server that hit 57 today without any reported issues
> when I would have expected it to cap at 50 or start exhibiting problems at
> that level.
>
>
>
> Anyone know why those counters are fairly flat?  Is there a better way to
> see if I’m hitting MaxCmds or do people just set it higher regardless?
>
>
>
>
>
> [image: Description: cid:image001.png@01CB850F.E2705F50]
>
>
>
> Thanks,
>
>
>
>
>
> *Dan Dill** *|*Systems Engineer* | *Harsch Investment Properties*
>
>
>

PNG image

Other related posts: