Do you know how much bandwidth you Citrix solution will consume? How can you predict the bandwidth load on remote locations? In this blogpost I will show you how you can use some simple freeware tools to record a realistic workload and emulate x numbers of users. The result will be logged to a CSV file.
What you need:
- ICAConnect.exe from: http://www.florisvanderploeg.com/connecting-to-xenapp-server-through-command-line/
- GPUPerf2.exe from: http://www.virtualexperience.no/sdm_downloads/gpuperf2
- Autoit from https://www.autoitscript.com/site/autoit/downloads/
- Some scripts that I will describe later in this blogpost.
- Create your test users in AD with a common prefix and ending with a number from 1-X where X is the amount of users you want to emulate. Assign a mandatory profile or no userprofile to the users.
- Add the testusers to the “Direct Access Users” local group on the XenApp servers you want to test with.
- A file share for the scripts and log files. Make sure users have append files permissions on the log share
First you have to create the workload. I recommend using the first test user account for this. Start the Au3Recorder.exe and record the keyboard and mouse clicks from your applications. When finished, save the Autoit script.
Logoff and on again and try the workload script by executing autoit.exe with the .au3 file you created. Verify that the script executes without any failures. You are going to have to re-record or edit the script if it fails or stops.
We are going to use GPUPerf2.exe to log bandwidth to a CSV file. To do that, create a config.ini file in the same folder as GPUPerf2.exe like this:
[Output] CSV=True CSVFILE=\\servername\scaletest\logs\%USERNAME%.CSV
Now create a login script that will execute GPUperf and the au3 script:
@echo off net use x: \\servername\scaletest\scripts x: start /d x:\ /B GPUPerf2.exe \\servername\scaletest\scripts\config.ini start /d x:\ /B AutoIt3.exe \\servername\scaletest\scripts\test.au3
Assign this script to the test users. Login with the test users and verify that it runs the GPUPerf tool and the .au3 script.
Finally we are going to create X connections to the server from a client machine. Install Citrix receiver 4.2 on the client machine and connect to the script share. Create a script like this on the share. This example will generate 5 users. You can add users in the “FOR %%G IN (your users here)”
@echo off PUSHD "%~dp0" FOR %%G IN (USER1 USER2 USER3 USER4 USER5) DO ( echo Connecting %%G ICAConnect.exe /Server %SERVERNAME% /Resolution %RESOLUTION% /Color %COLOR% /User %%G /Password %PW% /Domain %DOMAIN% )
Execute the script and watch it create multiple XenApp sessions with a recorded workload.
When finished, go to the log share and open the .csv files in excel. You’ll have to merge the content together and then you can create a nice chart like this to visualize you data.
You can now start playing with optimization policy to see how much bandwidth you can save.