Tuesday, March 15, 2016

Performance Testig with Citrix Protocol - Recording and Replay Procedure + Tips

These steps/procedures written were used during year 2012 when I have worked on Performance Testing of multiple citrix applications for customer [With HP Load runner 11.0]. Please follow up all these steps, It will make easy to work with citrix application for performance testing using HP tools such as Load Runner [LR] and Performance Center [PC]. It will be updated/modified in future If there will be any enhancement by HP for citrix in LR [Load Runner] and PC [Performance Center]. 

Pre-Condition [Environment]

1. Check availability of LR or PC for Performance Testing. 
2. Verify the license availability for Citrix ICA protocol 
3. Verify all the latest patches available for Citrix in LR or PC. 
4. Collect .ica file from Citrix admin. 
5. Verify the latest Citrix online plug in installed in the machine, where LR installed or user will do the performance testing. 6. Verify multiple Load generators available with latest load runner Citrix patches and Citrix online plug in.  

Citrix Scripting & Debugging 

Because the Citrix protocol relies heavily on bitmaps and coordinates to work correctly, there are few things to keep in mind when recording and editing the scripts.

Display and Resolution Setting 

When writing Citrix scripts in Load Runner, check the display settings of the generators where the scripts will be run. The color depth and resolution of the generators need to be the same as the settings on the computer where the scripts are written. If the settings are different, any sync_on_bitmap functions will fail. 

Also make sure resolution settings are consistent. To insure successful bitmap synchronization, make sure that the resolution settings match. On the recording machine, check the settings of the ICA client, the Recording Options, and the Run Time settings. On the Injector machines, check the settings of the ICA client, and make sure that they are consistent between all injector and recording machines. 

Recording Procedure 

a) Use 1024 x 768 Resolutions 
Supported resolutions (window sizes) are 640 x 480, 800 x 600, and 1024 x 768. Display settings of 1024 x 768 are recommended on the recording machine as it allows the Citrix window, whose default size is 800 x 600, to be displayed properly. Note that VuGen uses the Desktop's color settings. 

b) Do not resize Windows
It is recommended that you do not move or resize windows during the recording session. 

c) Disable Client Updates 
Disable client updates when prompted by the Citrix client.  

d) Windows Style 
Record all windows in the "classic" windows style—not the XP style. This is relevant for ctrx_sync_on_bitmap functions. 

To change the Windows style to "classic": 

  • Click in the desktop area. 
  • Choose Properties from the right-click menu. 
  • Select the Theme tab. • Choose Windows Classic from the Theme drop down list. 
  • Click OK. 

e) Keyboard Entry vs. the Mouse 
During the recording of a business process, navigate the application being recorded using the keyboard instead of the mouse. When Load Runner captures mouse clicks, it records the coordinates that were clicked on the screen. Replaying these coordinates is not very reliable. If your script relies heavily on coordinates, the scripts are more susceptible to being broken by application changes. As opposed to mouse clicks, navigate the application using the tab key or shortcut keys. Even if the application changes later, the script can be easily fixed by adding or deleting tab key entries in the script. 

f) Connection options 
ICA Files ICA files contain connection information for Citrix applications. Double-clicking on an ICA file will launch the application. A Citrix administrator can create this file for the person writing the Load Runner script. When setting up connection information inside of Load Runner, it is best to use an ICA file to connect. This makes the script more portable and more resilient to server change. If any of the connection information changes, in order to point the script to the new location, put the new ICA file in the script directory and replace the old one. For good housekeeping, it is a good idea of keep a copy of the ICA file that is currently in use in the root folder of the scripts folder. For example, if you are putting all of your scripts in c:\LoadRunner scripts\Project Name, you should put a copy of the ICA file in c:\LoadRunner scripts\Project Name. 

Recording Tips : 
  • When recording a session, make sure to perform the complete business process, starting with the connection and ending with the cleanup. End your session at a point from where you could start the entire process from the beginning.
  • Configure the Citrix server to completely close a session. Open the Citrix Connection Configuration dialog box. Choose Start > Programs > Citrix > MetaFrame XP > Citrix Connection Configuration. Double-click on the ica-tcp connection name. The Edit Connection dialog box appears. Click on the Advanced button. In the bottom section of the dialog box, clear the inherit user config check box adjacent to the On a broken or timed-out connection list box. Change the entry for this list box to reset. 
  • Record the connection process into the vuser_init section, and the closing process in the vuser_end section. This will prevent you from performing iterations on the connection process.
  • Display settings of 1024 x 768 are recommended on the recording machine. This will allow the Citrix window, which is 800 x 600 to be displayed properly.
  • When opening expanded menu options, click explicitly on each option—do not depend on the expanding menu. For example, Start > Programs > Microsoft Word, be sure to click on the word Programs.
  • If having trouble with window or dialog box names not being consistent, edit the script to use wildcards (*). For example, ctrx_set_window("Spelling and Grammar:*”);
Replay Procedure 

a) Set Initialization Quota 
To prevent overloading by multiple Vusers while connecting, set an initialization quota of 4 to 10 Vusers (depending on the capacity of the server) or apply ramp-up initialization using the Scheduler. 

b) Enable Think Time 
For best results, do not disable think time in the Run-Time settings. Think time is especially relevant before the ctrx_sync_on_window and ctrx_sync_on_bitmap functions, which require time to stabilize. 

c) Set Consistency between Machines 
If you intend to replay the script on another machine, make sure that the following items are consistent between the record and replay machines: Window Size (resolution), Window Colors, System Font and the other Default Options settings for the Citrix client. These settings affect the hash value of bitmaps, and inconsistencies may cause replay to fail. To view the Citrix Client settings, select an item from the Citrix program group and choose Application Set Settings or Custom Connection Settings from the right-click menu. Select the Default Options tab. Consult Application support group how to change settings if you are not able to do so.

d) Logging 
Logs help for debugging the script by returning values and information in play back. During development of the script, enable Standard or Extended log for debugging the script. But once you verify that script is functional and running as expected, it is advisable to disable log to conserve resource on injector machine. When running for large no of users via controller or performance centre, make sure that you disable the log. 

e) Run Vuser as thread Enable 
multithreading to run more Vusers per injector machines 

f) CITRIX Configuration 
Speed Screen Latency Reduction. 

For unknown network speed set it to Auto. It will turn it ON or OFF based on current network speed. 

Use Data Compression 
Enable it when working with limited bandwidth. But it is always advisable to set this option ON. 

g) Internet Protocol – Proxy 
Set the option as No Proxy

Debugging Procedure 

a) Debugging Vusers in the Controller 
Sometimes Citrix scripts do not work the same on different computers. Most of the time it is because of problems like color depth. If the Citrix scripts have problems running in the Controller during the debug run, there is a way to see visually what the scripts are doing. In the Controller, bring up the details for the group that is having problems. Under the Details section, make sure that “More” has been selected so that all of the options are shown. In the “Command line” text box, type –lr_citrix_vuser_view. 

If the scenario is ran with this option, it will bring up a Citrix window and show the virtual user as it is executing the script. When using this option, do not run a test scenario with many virtual users because the Controller will open one Citrix window for every user in the group. Because this is so resource intensive, it may crash the Controller if used with too many users. Set aside one group with a few users with this setting while the rest of the users are in different groups with standard settings. 

b) Generate Snapshot on error 
The “snapshot on error” feature run-time setting is very helpful when debugging Citrix virtual users. It is found in the miscellaneous options of the Run Time Settings. Anytime a virtual user fails, a screenshot is sent to the Controller which contains an image of what the screen looked like at the point of failure. It is a great way to diagnose syncing problems, or to troubleshoot other strange Citrix errors. 

c) Continue on error  
Load Runner provides a “Continue on error “option available for several Citrix functions. It allows individual functions to continue when sync does not work properly. There are several uses for this option. The most important use is for error trapping. If there is a potential for a function failing, Continue on Error option can be used on the function. In the subsequent lines of the script, the error can be handled appropriately and lines can be written to the log file to assist in debugging. 

d) Single Client Installation 
If you are unsuccessful in recording any actions in your Citrix session, verify that you have only one Citrix client installed on your machine—the Mercury version of the client. To verify that only one client is installed, open the Add/Remove Programs dialog box from the Control Panel and make sure that there is only one entry for the Citrix ICA client. 

e) Extended log 
You can view additional replay information in the extended log. To do this enable extended logging in the Run-Time settings (f4 Shortcut key) Log tab. You can view this information in the Execution Log tab or in the output.txt file in the script's directory. 

Saturday, March 12, 2016

This technology can cut website load time by 30%

Based on a research done at Harvard University students... ...

Slow-loading Web pages are surely one of the top frustrations on the Internet today, but new technology from MIT and Harvard promises to change all that. Announced on Wednesday, Polaris is a framework that determines how to sequence the downloading of a page's objects for faster load times overall.

Created by researchers from MIT’s Computer Science and Artificial Intelligence Laboratory (CSAIL) and Harvard University, the new system promises to decrease page-load times by more than 30 percent -- with the potential for reductions of almost 60 percent -- by minimizing the number of network "trips" the browser must make.

When asked to load a given Web page, the browser must reach across the network to fetch objects such as HTML files, JavaScript source code and images. Sometimes, thanks to what are known as dependencies, evaluating one object requires fetching and evaluating others as well. A browser might have to execute a file’s JavaScript code in order to discover more images to fetch and render, for example.

“It can take up to 100 milliseconds each time a browser has to cross a mobile network to fetch a piece of data,” says doctoral student Ravi Netravali, lead author on a paper he'll present at next week’s Usenix Symposium on Networked Systems Design and Implementation.

"As pages increase in complexity, they often require multiple trips that create delays that really add up," Netravali added. "Our approach minimizes the number of round trips so that we can substantially speed up a page’s load time.”

Polaris automatically tracks all of the interactions among objects, which can number in the thousands for a single page, and creates a “dependency graph” for that page, enabling objects to be loaded in the optimal order for fastest speed overall.
Polaris is particularly well-suited for large and complex websites as well as mobile networks, because they tend to have larger delays than wired networks do, the researchers said.

Researchers evaluated the system across a range of network conditions on 200 of the world’s most popular websites, including ESPN.com, NYTimes.com and Weather.com.

Source:
http://www.computerworld.com/article/3042416/internet/this-tech-can-cut-website-load-times-in-half.html