Citrix Storefront – Performance and Tuning – Part 2 – PNA Traffic simulation

Citrix Storefront – Performance and Tuning – Part 2 – PNA Traffic simulation

2017-05-30
/ /
in Blog
/

In part 1 I created a script to simulate users going through their web browser, logging in to Storefront, and launching an application.

In this post I’m going to simulate “PNA traffic”.  “PNA” is the icons delivered to your desktop or start menu via Citrix Receiver.

When connecting to Storefront or Web Interface the following can occur:

  1. This is your first connection and you need to download/cache the icons from the server
  2. This is a subsequent connection and you only need to validate you have all the icons
  3. You connect and PNA discovers you are missing an icon or have a new application assigned and proceeds to download any missing/different icons

All connections from PNA to Storefront/Web Interface start with “config.xml” .  From there, it queries for icons and downloads them.  This is what each of the 3 scenarios described look like:

 

The first time you connect via PNA

 

Subsequent connections after icons have been cached.

 

2 new applications published to the user

 

The first connection “config.xml” returns an xml file detailing the properties of the store.  Show icons on desktop/start menu? What are the URL’s for resource enumeration, reconnection, change password, etc.?  What logon methods are available?

All these questions and more are answered by the config.xml.

The second connection “enum.aspx” with a body size of 175 bytes is a POST request for the PRELAUNCH stage of PNA.  Are there any applications configured for PRELAUNCH?  POST request looks like this:

If you don’t have any applications configured for PRELAUNCH you receive a response like this:

The next enum.aspx request is a POST request that asks for all the icons:

And the response is a rather large one (1,758,490 bytes in my example) with application properties and details.  Part of the reason it’s so large is the icon data is stored as ASCII.  Here’s a small snippet of just 2 applications:

The subsequent POST request for icons (most roughly ~21,000 bytes in size) look like this:

With the response being:

Lastly, application launches over PNA are a POST request that look like this:

The content of that POST request looks like this:

And the response is a ICA file that Receiver executes.


With each of these requests we can see that PNA sends your username/password/domain to the server to get the relevant information.  This means we can script these requests using WCAT as the data being POST’ed is actually static.

Using the wcat scenario creator, download the WCATScenarioGenerator.dll and save it to: “C:\Program Files (x86)\Fiddler2\Scripts”

 

Open Fiddler.  Capture PNA operation by closing Citrix Receiver and reopening it.  Logon (if necessary) and launch an application.  If you want a more intensive logon, ensure your icon cache is cleared so that it forces new icons to be downloaded.  This will be the ‘scenario’ that we will be executing against.  Clean up any requests that don’t go to your web interface/storefront.  My Fiddler looks like this:

Select your items and in the black bar enter “wcat addtrans” and hit enter.

In the same bar enter “wcat save” and hit enter.

 

This will create a file called “fiddler.wcat” in your “C:\Program Files (x86)\Fiddler2” folder.

This file will actually require some cleanup as the WCAT scenario generator captures things literally and the scenario file requires escaping of double-quotes.

So in the wcat file, lines like this:

 

Need to be modified to look like this:

 

To execute our script, install wcat and launch the controller via the command line like so:

What each of these settings means:

-t = scenario file to use
-f = settings file to use (just using default)
-s = server to target
-p = port to connect
-c = clients that need to connect (this is the number of wcclient.exe’s that will connect to the controller)
-v = number of virtual clients that will connect
-w = warmup time (clients and virtual clients will connect in the amount they have / warmup time)
-u = duration for full load (all clients should be connected)
-n = cooldown, clients start disconnecting (opposite of warmup)

For my example, if I use my parameters for the controller then I need to start 10 clients be executing:

(Win7.bottheory.local is running the controller).

This command can be executed 10 times on the same box, even the same one as the controller, or on some random combination of 1-10 different boxes as long as you match the number of “clients” to the controller “client” excepted number of connections.


Lastly, here is a powershell script to measure the performance of each action of the PNA request.  You will need to modify it for your domain/(webinterface/storefront URL)/username/password.  This script will measure the amount of time each stage takes and the total, overall time and saves it as a CSV.

Here’s an example of the CSV output:

Some example commands:

Examples of “stress component” output:

And the script:

 

 

One Comment

  1. Pingback: Citrix Storefront – Performance Testing and Tuning – Part 5 – Establishing a Peak Load – Trentent Tye – Microsoft MVP

Post a Comment

Your email address will not be published. Required fields are marked *

*