none
Please wait for local session manager...

    Question

  • After a few days uptime our terminal servers (Windows Server 2008 x64 SP1) display the message "Please wait for local session manager..." when the client first establishes a connection to the terminal servers just prior to prompting them for their credentials.  The duration of the message seems proportional to the uptime - the longer it is up the longer the delay.  By the end of a week this message can remain for several minutes and by the end of two weeks you need to have a good book!  (okay; it is only about 10 minutes...)

    I had noticed that the Private Working Set memory seems to grow from ~10MB to ~100MB in a few days and to ~250MB within a week. 

    I am aware that there is a handle leak in lsm.exe when playing an audio file in Windows Media Player 11 (KB933245) but until now I had ruled this out as we do not have the Desktop Experience feature installed on the Terminal Servers and so Windows Media Player is not installed.  Add to that the fact we have not enabled the Windows Audio service and I find it hard to see how that known issue could be the cause of our problem.

    I am going to install the hotfix on one of the terminal servers later today to see whether is does have any impact but in the meantime I was wondering whether anyone else experienced this problem?

    Many thanks,
    Wednesday, June 24, 2009 9:09 AM

All replies

  • Hi,

    This issue issue can sometimes occur if you upgrade your Server from W2003 while the profile directory structure remains the same
    while fixes and patches, also applications can change the folders permissions - especially "Application data".
    You should try to recreate user profiles or move the Appdata and Application Data to another location and then migrate the user data into newly
    created application data folders which will be recreated after the user logins in again.

    Citrix Technology Professional, PubForum.net Founder , Love Microsoft &its people to bits!
    Wednesday, June 24, 2009 9:23 AM
    Moderator
  • Thanks Alex.

    In our case the roaming user profiles were not migrated - they were created afresh for all users using a new network share.  We used Folder Redirection for Documents and Favorites but as these do not (to my knowledge!) modify appdata I cannot see that this would be an issue.

    Wednesday, June 24, 2009 9:41 AM
  • Try to recreate one profile and see if that helps, just to make sure.
    Also did you upgraded from W2003?
    Citrix Technology Professional, PubForum.net Founder , Love Microsoft &its people to bits!
    Wednesday, June 24, 2009 9:50 AM
    Moderator
  • No.  All of the terminal servers are clean Windows Server 2008 x64 installs.

    I shall try recreating a profile the next time the symptoms appear (I restarted the servers this morning) and see if it makes any difference. 

    Out of interest why would this make a difference?  The problem occurs before the user is prompted for their credentials so how would the server know which profile to load?  Is it that the profiles are becoming corrupt in some way?  I would have thought that the logon would fail, or at least generate some kind of error, if this was the case but assuming you are happy to wait you are able to log on fine once the delay as gone. 
    Wednesday, June 24, 2009 10:03 AM
  • Well it is not really that profiles become corrupt (W2008 is fine in this matter, you would not even need to install UPH clean like in W2003). It is that after some patch (don't ask me the exact Q :-) ) the permission on the folders were mismatched (in W2003 -> W2008 migration) and thus this behaviour occured.
    Citrix Technology Professional, PubForum.net Founder , Love Microsoft &its people to bits!
    Wednesday, June 24, 2009 10:38 AM
    Moderator
  • Hey, I've been running into the LSM issue on a 2008 32-bit Terminal Server for a few months now. I've been able to tie it down to either a high volume of handles (usually excess of 100K), competition of programs with Local Session Manager for CPU resources, or too many running processes (300-400). Mitigation strategies....

    1. Disabled Windows Indexing service: this recovered 20-40K handles in itself.
    2. Something I found today: a CPU load balancer that resets affinity on processes to individual CPUs. Running every 5 minutes.

    http://www.brels.net/main/cpubalancer.html

    3. The programs I run as login applications: I encapsulate them in a Ruby script that checks the user name & computer name against a text file; if there is a match, future login attempts fail; the file is cleared every 10 minutes by a scheduled task.
    ---- The following is a version of my script that calls a simple IE browser ----
    # User throttle
    # Michael Adams, unquietwiki.com, 2010
    
    # Working class
    class Working
    
    	# Initialization
    	def initialize(userlist)
    		require 'CSV'
    		@client_cpu = ENV['CLIENTNAME']
    		@client_user = ENV['USERNAME']
    		@userlist = userlist
    	end
    	
    	# See if in userlist.txt
    	def in_userlist
    		found = false
    		if File.exist?(@userlist)
    			users = CSV.read(@userlist)
    			users.each do |user|
    				if(user[0] == @client_cpu)
    					if (user[1] == @client_user)
    					found = true
    					end
    				end
    			end
    		end
    		return found
    	end
    
    	# Add to userlist.txt
    	def add_userlist
    		CSV.open(@userlist,'a') do |users|
    		users << [@client_cpu,@client_user]
    		end
    	end
    	
    	# Del from userlist.txt
    	def del_userlist
    		begin
    		oldusers = CSV.read(@userlist)
    		CSV.open(@userlist,'w') do |newusers|
    			oldusers.each do |user|
    				if (user[0][0] == @client_cpu)
    					if (user[0][1] == @client_user)
    					else
    						newusers << user
    					end
    				end
    			end
    		end
    		rescue
    		end
    	end
    
    	# Run program + variable
    	def throttle(site)
    		if in_userlist == false
    			add_userlist
    			system('dummie.exe '+site)
    			del_userlist
    		end
    	end
    end
    
    # Check for aguments: quit if none
    if ARGV.length < 2 then
    	puts "Synatx: throttle.rb userfile site"
    else	
    	process = Working.new(ARGV[0])
    	process.throttle(ARGV[1])
    end
    
    • Proposed as answer by unquietwiki Wednesday, April 7, 2010 9:43 PM
    Saturday, April 3, 2010 5:52 PM
  • Update:  Neither the hotfix nor creating a new profile resolved the issue.

     

    I have just taken a quick look at a couple of the terminal servers:

     

    TS1 (36 users logged in)
    -----------------------------
    Uptime:      ~57hrs
    Handles:     ~220000
    Threads:     ~4200
    Processes:  ~370

     

    TS2 (24 users logged in)
    -----------------------------
    Uptime:      ~57hrs
    Handles:     ~140000
    Threads:     ~2700
    Processes:  ~240

     

    I will track the handles/processes for a while to see how they fluctuate.

    Many thanks,

    Tuesday, April 6, 2010 11:21 AM
  • 32-bit 2008 TS, 45 users logged in atm: ~101hrs, ~66K handles, ~328 processes

    Using the load-balancer on a 5 min schedule has improved application responsiveness for some of my users.

    Wednesday, April 7, 2010 9:47 PM
  • ~203hrs: atm ~18 users (some disconnected), ~39k handles, ~174 processes, ~1394 threads

     

    Monday, April 12, 2010 3:42 AM
  • Okay, had a 10d1h run before I had to hard boot my VM on the account of LSM issue. Added BRELS to the login script for my regular users: see if the logins themselves can force rebalancing...
    Tuesday, April 13, 2010 6:01 PM
  • Running the balancer on every user login made it worse: reverted back to just every 5 min, but also added on system logon.
    Tuesday, April 13, 2010 6:45 PM
  • MS seems to have heard us, at last!

    http://support.microsoft.com/kb/980568

    A terminal server that is running Windows Server 2008 stops responding when lots of clients make terminal sessions to the server

     

    • Proposed as answer by unquietwiki Monday, May 10, 2010 2:56 AM
    Monday, May 10, 2010 2:56 AM
  • Did this help you at all?

    This has been an ongoing problem for me for over a year now. 

    Before a user even gets to log in, it sits at Please Wait for Local Session Manager for minutes. Eventually it will present a login screen (sometimes times out) and then the user can log in. It will then either sit at the session manager again for a while and eventually log in minutes later or kick them out. As it is before the user logs in, it has nothing to do with their profile.

    The only fix I have so far is to pull the server out of the round robin DNS and set for a reboot that night. Not good at all.

    As others have said, sometimes it sorts itself out after a while. lsm.exe is usually sitting above 150MB and sometimes lsm.exe is running higher CPU.

    Maybe I will also raise a paid call with MS as it isnt right....

    Thanks! 

    Wednesday, May 19, 2010 4:11 PM
  • Is this machine in a farm and is this machine a dedicated redirector?

    Thanks.

    -Huei

    Friday, June 18, 2010 3:46 PM
    Moderator
  • Problem solved....

    When using Windows 2003 terminal services manager connected to Windows 2008 servers it results in lsm.exe memory leak. As said above this memory leak simply continues and within 24 hours is usually above 100mb plus I notice heavy CPU usage for lsm.exe. Simply using Windows 2008 terminal services manager instead results in no problems at all or simply close down Windows 2003 terminal services manager every couple of hours.

    Monday, July 19, 2010 12:05 PM
  • I was able to solved this problem.

    This was caused due to broken secure pipe between DC and Member server.

    Boot your server in Safe Mode with Networking mode, rename all the exiting profiles except local one.

    disjoint it from domain and reboot in normal mode. This time server comes up fine in normal boot.

    Rejoin domain and reboot and everything works smooth as usual. Problem Solved for me with above steps.

    Cheers!!

    Prashant

    Tuesday, October 14, 2014 2:38 PM