LoadRunner and Performance Center
Showing results for 
Search instead for 
Do you mean 

Enhancing the number of TruClient Vusers using Terminal Services in Load Testing software

hilale ‎09-09-2016 11:13 AM - edited ‎09-12-2016 01:53 AM

Guest post by

 

Eyal Jacob.png

 

Eyal Jacob, TruClient RnD team

Eyal Rosner.jpg

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:

  1. Load Generator configuration for the load test
  2. OS configuration on the participating Load Generators in order to support terminal services

 

1. Load Generator configuration per test

Performance Center

  1. Open the load test for editing
  2. Select Load Generator of a group and click on it

Performance Center select load generators box.png

 3. Click on the setting for the relevant LG

setting for the relevant LG.png

 

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

 

PC load test.png

 

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

LoadRunner

  1. Open controller and click on the button for the Load Generators settings:

load Generators.png

 2. Select the Load Generator that will run TruClient script(s) and click on “Details…”

LoadGeneration.png

 

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

Load Generation Information.png

 

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 System requirements information can be found here.

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

  1. Open Server Manager
  2. Go to Manage -> Add Roles and Features

Server manager dashboard.png

 

3. Select Remote Desktop Service Installation

Remote Desktop Service Installation.jpg

 

 4. Click Next and select Quick Start

Add Roles wizard.png

 5. Click Next and then "Session-based desktop deployment"

Session-based desktop deployment.jpg

 

6. Next -> Next until the dialog below appears:

Select "Restart the destination server automatically if required"

confirmation.png

 

7. Click on Deploy

deploy.png

 

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.

 

  1. From Server Manager main page select “Remote Desktop Services”

Remote desktop.png

 

2. Select “QuickSessionCollection”

server manager.png

 

3. In “REMOTEAPP PROGRAMS” click on “TASKS” and select “Publish RemoteApp Programs”

RemoteApp.png

 

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:

select remote app.png

 

5. Continue until completion

completion.jpg

 

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

TS launcher.png

 

 

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”

 

allow users to connect.png

 

Verify that “TSLauncher.exe” can be launched on Connection

  1. Open Remote Desktop Connection

remote desktop connection.png

 

2. Extend options and go to Programs tab

Remote desktop connection 2.png

 

3. Enter TSLauncher.exe location in “Program path and file name:” field and pass “-magentproc” as parameter

     E.g. “D:\HP\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

  1. 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.

  1. Open the registry by running regedit.exe
  2. Go to key HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client
  3. If there is a REG_DWORD value named “AuthenticationLevelOverride” set its value to 0
  4. 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.

 

 

Additional Resources

If after setting the above the test fails to start, refer to following KBs:

  1. Terminal Services KB - A hotfix if mentioned in the PC version being used.
  2. Terminal Services failure when running multiple terminal services – configuration to overcome a defect in OS behavior for multiple RDP session initiated by a user running from session 0.

 

 

 

Interested in more information about TruClient, visit the  LoadRunner Help Center.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

About the Author

hilale

Comments
sebastiena
on ‎09-14-2016 01:27 AM

 Very useful article and settings for Terminal Services! Thanks

I have a related question regarding the Legal Notice pop-up that is enabled on a lot of companies nowadays.

When that pop-up is enabled and configured at Group Policies level it cannot be deactivated. 

 

This prevent the use of "Create New Terminal Services sessions" and force us to use "Connect to existing Terminal Services sessions".

Is there any known LR/PC workaround available?

 

Cheers,

./SJA

 

Note: the keys are:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system

LegalNoticeCaption and LegalNoticeText

LoadTestGuy
on ‎09-15-2016 10:10 AM

This is pretty much the same solution to Citrix vuser scalability, and that goes waaaay back (and works really well for GDI object-constrained systems).  Unfortunately the limitation I have always had with TruClient scripts is not GDI objects but CPU - on the load generators I have access to, I rarely get more than 15 TC vusers running (maybe 20 if I'm lucky) before the CPU is completely slammed, and then the performance I measure is affected as much by load on the client as it is by load on the server.  My only recourse is to add more LGs, and I can't usually get more hardware allocated.  I like TruClient for scripting really tough web apps, but it sure is hard to run large scale load tests with that vuser type.

Events
June 6 - 8, 2017
Las Vegas, Nevada
Discover 2017 Las Vegas
Join us for HPE Discover 2017 in Las Vegas. The event will be held at the Venetian | Palazzo from June 6-8, 2017.
Read more
Each Month in 2017
Online
Software Expert Days - 2017
Join us online to talk directly with our Software experts during online Expert Days. Find information here about past, current, and upcoming Expert Da...
Read more
View all