Category Archives: Citrix

receiver-icon

Citrix Receiver for Mac and British keyboard tomfoolery.

receiver-iconTomfoolery? indeed! Here is a problem that drove me nuts on a daily basis and I’m delighted to report the great Simon Frost and Dustin Norman of Citrix heard my cries of frustration and kindly resolved my issue outright. Stand up gentlemen they are!

My issue was simple, as a developer and powershell zealot, I regularly used the pipe Symbol (|) in anger. Well in anger i mean, I was literally angry as despite pressing the frickin pipe key, an imposter appeared in the remote console…

pipewoes

  • Looked like a pipe? Yes!
  • Acted like a pipe? NO!

So anyway, being a Citrix CTP has it’s benefits, I reached out to the aforementioned blokes and sure enough a few emails were exchanged and poof! issue resolved.

To paraphrase Dustins email:

  1. Open ~/Library/Application Support/Citrix Receiver/Config in a text editor
  2. Find the KeyboardLayout setting in the [WFClient] section
  3. Change KeyboardLayout to: British
  4. Save the file
  5. Launch the session

Tada! Pipe back to normal. Thanks again Simon and Dustin.

Threadlocker 128x128

ThreadLocker 2.0 is live!

Threadlocker 128x128Back in 2012 I wrote a utility called “ThreadLocker” for dealing with CPU heavy processes or multi threaded processes that have a nasty tendency to cause sluggish performance or even hangs in shared computing environments.

You can read all about the original concept here. My good friend and fellow CTP Barry Schiffer also wrote a really good article about the need for a product like ThreadLocker here.

 

Some history:

In essence, ThreadLocker was a utility for both shared and 1:1 desktop environments. It allowed you to layer in rules for processes that had a history of high or discruptive CPU usage, to protect the other users (in a shared environment) or to protect other running processes and the users interface (explorer.exe) while a large compute job was occurring.

ThreadLocker exploded with popularity and has received well over 100,000 downloads in the last three years. Alike ThinKiosk, ThreadLocker is a tool I regularly come across in my customers environments while consulting and it always suprised me with it’s uptake and popularity. I have observed ThreadLocker in VDI, SBC and even on stand alone workstations with great levels of success.

 

Moving on:

One of the frustrations I had with ThreadLocker, was any .NET based language (c#, vb.net, etc.) was never quick enough to be able to add an intelligent aspect to the utility without actually making CPU usage worse by implementing. ThreadLocker 1.0 relied on static rules and any new processes would have to be observed and added.

Recently David Coombes and I undertook the side project of redesigning ThreadLocker to run in c++, adding the raw speed we needed to be able to make intelligent decisions based on CPU usage and react in a fraction of a second to a sudden CPU spike. ThreadLocker 2.0 was designed to specifically tackle two issues:

  • Processes comsuming a large % of CPU and is multithreaded.
  • Many buggy or heavy processes, each consuming a core each.

We didnt want to tackle this with the approach of many others, where they’ll pause and resume threads many times a second creating a “SawTooth” effect on the processes CPU usage. We wanted the processes to run as fast as they need up to a certain threshold and only be restricted when contention is likely.

Having experienced other vendors approaches where process priority is dropped, many times this simply does not cut it as a heavy process, even at idle priority, will cause the other users and processes to feel slow and sluggish.

Why is ThreadLocker different?

With ThreadLocker 2.0, you can elect a percentage of your CPU cores that ThreadLocker can use for isolating these processes. When a process violates the ThreadLocking criteria, they are locked into these subset of cores to contend with any other processes that are also ThreadLocked, leaving well behaved processes to be able to take advantage of all cores in system. Once they start to behave again and do so for a certain amount of time, the processes are dropped back into the “wild” unless they decide to misbehave again.

This approach is extremely fast (ThreadLocker consumes less CPU than Microsoft’s own Task Manager) from a processing point of view and also has the benefit of allowing users to multitask with other applications while, for example, Excel hammers the ThreadLocking cores during a calculation.

The end result has been fantastic. Threadlocker can be installed and up and running in seconds. There is no longer a requirement for static rules and out of box, all aspects of the logic can be tuned to suit your environment, but more than likely wont be needed.

 Demo Video:

 


Availability

We are proud to announce the general availability of ThreadLocker 2.0 and more information can be found on our website at http://www.thinscaletechnology.com/threadlocker.

 

New Free Tool: Citrix Director Notification Service

DirectorNotificationCitrix Director for XenApp and XenDesktop can be a great utility for information about your Application / Desktop virtualisation environment. In Director you can find a wealth of information about the provisioned assets, the Controller, Licensing and Hypervisor status and the current running resources.

One area it’s always lacked is real time alerting. In order to really know what’s going on in your environment you need to be logged into director and watching. This is less than ideal and few monitoring vendors have endeavored to actually pull this data into their own solutions.

With the help of Rachel Berry, Prateek Kansal and Sridhar Mullapudi from Citrix. I set about diving into the logic and monitoring options within the FMA architecture. Citrix did a great job here and most if not all of it was readily available in PowerShell and oData. So, with the help of Citrix and a little bit of hard work, I’m very pleased to announce my latest free tool!

Continue reading

Accurately checking the Citrix PVS “cache in Ram, Overflow to disk” RAM cache size

Citrix_Provisioning_Services_ImplementationCitrix Provisioning services “Cache in RAM, overflow to disk”, even with it’s challenges is something I’ve always felt was a great idea, hell, I foresaw it’s implementation back in 2012!

Not withstanding the issues that can occur when the cache is heavily in use, it’s a great piece of technology. One of the features you see on twitter repeatedly is trying to report on the exact size of the PVS cache in RAM.

Many blogs and scripts (Matt’s here, as an example) will take the raw performance counter details for Non Paged Pool memory and assume this is the size of the cache. This is faulty logic, but close enough. It’s like looking into a can of beans and trying to determine which one gave you gas.

The Non paged Pool is a collective pool of memory used by the system that guarantee’s the services using it (drivers, etc) that the contents will never reach the disk and will always be maintained in memory. As an example, imagine you created your own disk driver, but the disk driver tried to reference it’s memory and it had since been flushed to the disk…. Chicken and Egg stuff!

Microsoft has a fairly clear description here:

The memory manager creates the following memory pools that the system uses to allocate memory: nonpaged pool and paged pool. Both memory pools are located in the region of the address space that is reserved for the system and mapped into the virtual address space of each process. The nonpaged pool consists of virtual memory addresses that are guaranteed to reside in physical memory as long as the corresponding kernel objects are allocated.

So with this in mind, taking a total of the Non Paged Pool memory and assuming it’s PVS is “OK”… But not accurate. Many other sources can bloat that memory cache, particularly in x64 systems where limits on these pools are now enormous compared to the tiny pools we had to deal with in x86 architectures.

Nerdy digression aside, if you REALLY want accurate information on what’s going on inside of this pool. You need to grab a copy of Poolmon from the Windows Driver Kit (WDK). Download the WDK, install it and you’ll find your poolmon in:

C:\Program Files (x86)\Windows Kits\10\Tools\x64\poolmon.exe

Once you have a copy, fire up poolmon and you’ll see in all their glory.

pvs

Pro tip: Press “p” once to sort my non pooled, then “b” to sort by bytes used.

Each pool tag and the respective space they are using. Interestingly, the Citrix caching technology seems to use the “VhdR” pooltag allocation. There’s also a Microsoft Pool tag for this (http://blogs.technet.com/b/yongrhee/archive/2009/06/24/pool-tag-list.aspx) but the case sensitivity differences between VhdR and VHDr may make all the difference.

I did reach out to Citrix on this one, but they didn’t provide any further insight.

Any-who, if you want to see the size of your PVS cache accurately? Use PoolMon. Here’s a quick script using poolmon to get the GB value back:

$poolmonpath= "d:\poolmon.exe"
$poollog= "$env:temp\poolmon.txt"
if(test-path $poollog){Remove-Item $poollog}
Start-Process-FilePath $poolmonpath -ArgumentList "-n $poollog" -Wait
((Get-Content $poollog | ? {$_ -like "*VhdR*"}) -split "\s+")[6] /1gb
if(test-path $poollog){Remove-Item $poollog}

Update to Caffeine for Receiver

Caffine 2Just a quick note to say I’ve finally updated Caffeine for Receiver to support receiver 4.2.

I had neglected to update this tool for a while, until I actually needed it and the remote screen saver annoyed the hell out of me. necessity is the mother of product maintenance it seems!

Anyway, I digress, check the original blog post here for the downloads and configuration options.

In other news, if you’re familiar with ThreadLocker, watch this space, it’s about to get a serious overhaul!

PS: stop asking me for a mac client, it’s not possible as there is no ICA SDK / API for mac.