Guest post by
Eyal Jacob, TruClient RnD team
Eyal Rosner, System Architect –Performance Center RnD
TruClient is a tool for creating test scripts that can then be used in load testing web applications.
TruClient records your actions as you navigate through your business process. It creates a script from your actions—which you then run in load testing. In non-interactive mode replay, TruClient spawns a new browser instance for every Virtual User, to simulate separate “real” users.
On a powerful Load Generator, it is only natural that one would want to run as many Virtual Users as the system can sustain. Remember that each browser consumes different system resources (depending on the AUT being tested). While most of us are familiar with the limitations around CPU and Memory, there is also a lesser-known limitation related to Windows graphics device interface (GDI), which enables applications (such as browsers) to use graphics and formatted text on both the video display and the printer.
GDI Objects:
GDI objects represent graphical device interface resources like, fonts, bitmaps, brushes, etc.
As with CPU and Memory, each browser consumes different GDI objects depending on the page(s) it displays. In our case, the amount of GDI objects consumed depends on the AUT being tested.
In the Windows Operating System, there is a known limitation on the amount of GDI objects that can be created in a session. The theoretical limit is 65,536 GDI objects per session. However, the maximum number of GDI objects that can be created per session is usually much lower.
Therefore, when running large amount of Virtual Users, we might encounter GDI object limitation while not reaching high CPU or Memory utilization.
Reaching GDI objects limitation results in Virtual User failures such as “IPC connection to the browser is lost” or “Failed to create IPC connection to the browser”.
To overcome Windows GDI limitation one can use LoadRunner\Performance Center terminal sessions integration
Each session has its own GDI object limitation thus, one can multiply the available GDI resources by the number of opened sessions.
In general, enhancing the number of Virtual Users in a load test with terminal services, depends on the machine being used and the AUT resources utilization.
As a specific example: running a test on a machine with 64GB RAM and 32 logical processors where 110 Virtual Users consumed ~57600 GDI objects, can be enhanced to 330-340 Virtual Users with terminal sessions.
In order to configure running Vusers on Load Generator using terminal services there are two types of configuration:
- Load Generator configuration for the load test
- OS configuration on the participating Load Generators in order to support terminal services
1. Load Generator configuration per test
Performance Center
- Open the load test for editing
- Open LG Properties:
- Prior to 12.56 - Select Load Generator of a group and click on it and then click on the setting for the relevant LG
- PC 12.56 onwards - open the 'LG Management' view (next to 'Assign LG's' on the toolbar) and check the relevant LG
4. Select “Enable Terminal Services”
5. Set the requested number of Terminal Services to be opened on the Load Generator
Note: the number of terminal services you can use depends on the Microsoft license for Remote Desktop Services.
6. Set the maximum number of Vusers to run in a Terminal Service
7. Select “Create new Terminal Services sessions”
8. Click OK
Note: The settings for virtual Load Generator or actual Load Generator will take effect for every group that uses that Load Generator.
Note: The number of Terminal Services to open as well as the maximum number of Vusers to run in a Terminal Service is depend on the AUT which effects on the number of GDI being used by the browser, so the actual value should be define using trial and error
9. Save the load test
10. Run the test
11. Number of TruClient Vusers should increased
- Open controller and click on the button for the Load Generators settings:
2. Select the Load Generator that will run TruClient script(s) and click on “Details…”
3. Select “Terminal Services”
4. Select the checkbox for “Enable Terminal Services Manager”
5. Set the requested number of Terminal Services to be opened on the Load Generator
Note: The number of terminal services you can use depends on the Microsoft license for Remote Desktop Services.
6. Set the maximum number of Vusers to run in a Terminal Service
7. Select “Create new Terminal Services sessions”
8. Set the credentials of the user that will be used to connect to the Load Generator
9. Click OK
10. You can verify the settings by connecting to the Load Generator using the “Connect” button in the Load Generators dialogs. If connection successful you will see an RDP sessions being open. The number of RDP windows will be according to the value supplied the Load Generator settings as shown above.
2. Operating System configuration for Terminal Services on Load Generator
In general you should ask IT to make the required configuration on the Load Generator(s) to support more than two terminal sessions which is the default supported by Windows.
You will need to have a Microsoft license server for the terminal sessions.
The Below steps are temporary configuration until IT can configure the Load Generator to use a valid centric license server.
These configurations will be sufficient for testing the amount of Vusers that can run using up to two terminal sessions. The configurations are limited to a time period of 120 days based on the Microsoft grace period for Remote Desktop Services (RDS). After that, if you don’t set a valid license for terminal services you will not be able to use the terminal services for the load test.
Running Vusers using terminal services is supported only on Windows Server versions that are listed in the system requirements supported by the Performance Center/LoadRunner version being used.
The configuration below applies to Windows Server 2012 R2 and should be performed on each Load Generator that will participate in the load test.
Add required server roles
- Open Server Manager
- Go to Manage -> Add Roles and Features
3. Select Remote Desktop Service Installation
4. Click Next and select Quick Start
5. Click Next and then "Session-based desktop deployment"
6. Next -> Next until the dialog below appears:
Select "Restart the destination server automatically if required"
7. Click on Deploy
Publish TSLauncher.exe as RemoteApp
After adding the required roles as shown above, you need to configure the application TSLauncher so that it can be executed when the controller open RDP session to the Load Generator.
- From Server Manager main page select “Remote Desktop Services”
2. Select “QuickSessionCollection”
3. In “REMOTEAPP PROGRAMS” click on “TASKS” and select “Publish RemoteApp Programs”
4. Click on “Add…” and browse to <Load Generator installation folder>\bin and select file named “TSLauncher.exe” and click Ok which will add this program to the allowed program list:
5. Continue until completion
6. Configure TSLauncher.exe to accept parameters:
a. In “REMOTEAPP PROGRAMS” right click “TSLauncher.exe” row and select “Edit properties”
b. Go to parameters menu
c. Select “Always use the following command-line parameters”
d. Set parameter -magentproc for the TSLauncher remote app settings
7. Configure Group Policy to allow multiple connections
a. Run gpedit.msc from a command prompt
b. Go to “Computer Configuration\Policies\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Connections”
c. Disable “Limit number of connections” and “Restrict Remote Desktop Services to single…”
d. Enable “Allow users to connect remotely by using Remote Desktop Services”
Verify that “TSLauncher.exe” can be launched on Connection
- Open Remote Desktop Connection
2. Extend options and go to Programs tab
3. Enter TSLauncher.exe location in “Program path and file name:” field and pass “-magentproc” as parameter
E.g. “D:\MF\Load Generator\bin\TSLauncher.exe” -magentproc
4. In General tab, enter IUSR_METRO credentials or Performance Center system user in case the default user was changed. In case of LoadRunner, enter any valid user with sufficient privileges to connect using RDP.
5. Press Connect and check if the RDP session is opened successfully.
Registry settings to prevent pop ups to open RDP session
- Login to the PC Hosts that are being used as controller using the Performance Center system user. In case of LoadRunner, login to controller machine using the interactive user being used to run the test.
Note: Instead of logging in with PC System user and setting the registry values per this user you can login using any user with required permissions for setting registry and set the same values in machine wide level, by setting the keys to the same path but the root key element is HKEY_LOCAL_MACHINE instead of HKEY_CURRENT_USER.
- Open the registry by running regedit.exe
- Go to key HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client
- If there is a REG_DWORD value named “AuthenticationLevelOverride” set its value to 0
- If there is no REG_DWORD value named “AuthenticationLevelOverride”:
a. Right click and add new DWROD (32-bit) value.
b. Set the name as AuthenticationLevelOverride and value 0.
6. Go to key HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\LocalDevices
a. For every Load Generator that is being used with terminal services create the following registry value:
i. Right click and add new DWROD (32-bit) value.
ii. Set the name as the Load Generator machine name.
iii. Set the value to 4c (Hex).
7. Start the load test.
Note: The above settings are required in order to prevent RDP pop ups to allow untrusted publisher and trust the Load Generator certificate.
Note: If the registry settings above were not configured and you started a load test with terminal services configuration on the Load Generator, the load test will start successfully but the Vusers will be stuck in pending state for a while and then move to error state.
Interested in more information about TruClient, visit the LoadRunner Help Center.