Welcome!

Java Authors: Maureen O'Gara, Liz McMillan, Walter H. Pinson, III, Yakov Werde, Tony Bishop

Related Topics: Adobe Flex

Adobe Flex: Article

Keys to Success When Load Testing Today's Flex Applications

A Best Practices Practical Approach

To find out the different break points, you want to progressively increase the load of the application. The test results should answer the following questions:

  • How many users can the application handle while maintaining an acceptable response time?
  • What is the load threshold above which the server begins to generate errors and/or refuse connections?

How to Test Your Application
To produce a realistic test, it is essential to pay special attention to three key items:

1. Number of Virtual Users: The number of virtual users must be close to the number of real users once the application is in production, with a realistic think time applied between pages. Think time is the time it takes a user to click through to the next page from the current one. Avoid testing with too few virtual users and a reduced think time.

2. Type of Virtual Users:  Not all users employ a web application in the same way. Therefore it is important to define a virtual user for each user profile: simple browsing, browsing with modifications, system administrator, etc.

3. User Accounts and Values: Testers should use variables to dynamically modify key values such as user account logins or certain form parameters (such as productID in an e-business application).

Tips to Keep in Mind when Testing Flex
To improve application performance, Adobe’s Flex AMF (Action Messaging Format) protocol is used to exchange data between an Adobe Flash application and a database, using a Remote Procedure Call. Many load testing tools rely on data being sent over HTTP and don’t tap into AMF protocol. Therefore, they don’t go deep enough to understand what is exchanged between client and server. When load testing Flex applications, it is important to find a tool that has a dedicated module for Flex so that AMF messages can be replayed without special processing.

Tip 1: Make sure your load testing tool can automatically process serialized objects and internal identifiers
AMF binary messages contain serialized objects. These objects are different from the standard Java serialization. For optimum testing, make sure your load testing tool displays these objects so that you can view, edit, and validate the results.  In addition, AMF messages protocol uses internals identifiers (clientId, DSId ...) parameters to maintain the AMF session.  Parameters in an AMF session are dynamically generated and are numerous. To avoid painful manual configuration of these parameters, make sure that your load testing tool automatically processes serialized objects and identifiers. 

Tip 2: Make sure your load testing tool can support customized external messages
AMF3 compact binary format helps integrate binary data exchange into all server platforms. The protocol improves the quality of all remote and messaging solutions for Flex and optimizes data exchange. AMF3 reduces the quantity of exchanged information and avoids redundant messages. In particular, AMF3 Externalizable messages allow developers to customize the serialization of objects exchanged in AMF.

When selecting a load testing tool, make sure it allows you to integrate custom code into it. For optimum testing, the customized code should be loaded and run by the testing tool to correctly replay custom messages. The capacity of the tool to accept the developer classes is mandatory to simulate loads.

Tip 3: Make sure your load testing tool can support Remote Messages, Polling and Streaming
Flex servers use AMF protocol update client data in two ways:

1. The polling method: This involves the browser querying the server at regular intervals. Technically simple in its implementation, the method's downside is that it needlessly overloads the server and it is not very reactive.

2. The streaming or "push" method: In this case, the client sends a single request to the server, and the server responds when pertinent information is available, without closing the request. Thus, the server can again send information to the client using the same connection, without having to wait for a new request. Using this method, client data can be rapidly updated while the network traffic is kept minimized.

For best results when handling the performance of a streaming request, make sure your load testing tool measures the response time after each response data block sent by the server, without waiting for the end of the real HTTP request.

The testing tool must also be able to keep the stream open when it plays a streaming request. This request will block the connection so the tool has to use a second connection for classic requests.

Conclusion
RIAs like Flex technology allow a richer, faster and more interactive experience with browser-enabled applications and services. While next-generation applications like Flex promise a much better customer experience, they also have the potential to overwhelm the servers and networks that deliver the content to client browsers.

Given the potential peak demands of these applications, it’s best to approach web application development with RIAs like Flex with care. When using Flex or other RIA technology, you need to verify that your applications can handle the loads in a pre-production environment first. Poor application performance, unexpected deployment issues, and server malfunction can compromise your web application. But by following many of these best practices and techniques explained in this article, Flex developers can improve reliability, performance, reduce development costs and, most important, help your company deliver what it promised in terms of application functionality and performance.

More Stories By Daniel Baloche

Daniel Baloche is Vice President, North America at Neotys (http://www.neotys.com), a provider of software solutions to improve the quality and performance of information systems. Its flagship solution, NeoLoad, tests the performance of web applications using customizable scenarios for load and stress.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.