The Vaadin Wiki is temporarily in read only mode due to large recent spam attacks.

Outdated content

Vaadin Scalability Testing with Amazon Web Services

WARNING: This wiki page was last edited over a year ago and might be outdated.

This article explains how you can test the scalability of your application in the Amazon Web Services (AWS) cloud. The AWS services used in this article include Amazon Elastic Compute Cloud (EC2) and Amazon Relational Database Service (RDS). The use of Amazon Elastic Load Balancing (ELB) is also briefly discussed. The application under testing is called QuickTickets, a fictional Vaadin web application that sells movie tickets to theaters all over the world. See also the blog post about the experiment and the results.

To fully understand this article and follow through the steps, you should have some basic knowledge of Amazon Web Services (AWS), Apache JMeter, MySQL and Linux shell usage. You will also need to know how to checkout the QuickTickets project from SVN and run Ant targets to generate test database and to package the application as a WAR file. If you are not familiar with JMeter, you might want to first see JMeter Testing wiki article for a quick tutorial on how to use JMeter with Vaadin applications.

Please notice, that using the AWS services discussed here will incur some expenses.

1. Setting up the Amazon RDS database #

  • Click the Launch DB Instance button.
  • Select the following properties for the DB instance:
    • DB Instance Class: db1.m1.large
    • Multi-AZ Deployment: No
    • Allocated Storage: 5 GB
    • DB Instance Idenfitier:
    • Master User Name:
    • Master User Password:
  • Additional configuration:
    • Database Name:
  • Management options:
    • Backup Retention Period: 0 (disable backups)
  • After the DB instance is started up, connect to the database with the MySQL client.
  • Once you have connected to the DB, run the following command:
alter database quicktickets charset=utf8;
  • Note that the following steps might be a bit faster to do in an EC2 instance in the same zone as the RDS database. But you can of course do these in your local machine as well.
  • Take a checkout of the QuickTickets application project from the SVN repository.
mysql -uquicktickets -p<your-password>> -h<db-instance-endpoint>> < QuickTickets/db/createSchema.sql
  • Create a huge test data by running Ant target
    of the QuickTickets/build.xml script.
cd QuickTickets
ant create-huge-database-script
  • This target will generate a huge SQL file (500MB) into a temporary directory containing loads of test data. The location of the file is printed to the console by the Ant target.
  • Run the resulting
    file to the quicktickets database (this will take quite a while, well over an hour).
mysql -uquicktickets -p<your-password>> -h<db-instance-endpoint>> < /tmp/quickticketsdata.sql

2. Setting up EC2 instance(s) for QuickTickets #

  • Click the Launch Instance button.
  • Select Community AMIs tab and search an AMI with following id:
  • Launch a large instance of the AMI. Consult the Amazon EC2 documentation for more details on how to launch a new instance.
  • Login to the started instance as root via SSH.
  • Repeat the above procedure for all the instances you want to setup.

3. Deploying the QuickTickets application #

  • Add the Private DNS of all the instances you have setup to the list of Memcached servers in the
     file with the default Memcached port 11211. For example:
<!-- Memcached servers -->
  • Create a file called
    to the root directory of the project (right next to the
    ). Set the
     property to
    and add your Amazon RDS database configuration details to the file. For example:
# Debug or production mode?

# Database configuration
  • Run the
    target of the
    to compile and package the WAR file (resulting in the
ant package-war
  • Deploy the WAR file into all EC2 instances you just created by copying the
  • Now you should be able to access the application through your web browser by opening the following URL:
  • If you still want to try using ELB, you should add
    to the JMeter JVM args and use the following settings with the ELB:
    • Port Configuration: 80 forwarding to 8080
    • Enable Application Generated Cookie Stickiness for cookie name:
    • Set the Health Check port to
    • Ping Path:

4. Setting up EC2 instance(s) for JMeter #

  • Launch and login to a new EC2 large instance (using the AMI
    ). See the first 5 steps of the second chapter.
  • Download the JMeter script.
    • The script contains prerecorded ticket purchase sequence that lasts about 2.5 minutes.
  • Open the script in JMeter and make sure you configure the following settings to suit your test:
    • HTTP Request Defaults (set the server name)
    • Thread Group (thread count, ramp-up, loop count)
    • Summary report (result file name)
  • Upload the test script to the JMeter instance(s).
  • When logged in as root to the JMeter server you can start the test from command line with the following command:
~/jakarta-jmeter-2.4/bin/ -n -t ~/jmeter-test-script.jmx	
  • After the run is complete you'll have
    file (or the filename you used for the report) which you can open in JMeter for analyzing the results.

5. Results #

Jump directly to the results: blog post about the experiment and the results.

0 Attachments
Average (0 Votes)