Load Stress Your System: Cloud Computing is not only the Problem, It’s the Answer as Well

The elasticity of a PaaS solution allows you to react quickly to increasing load, but at a cost. How do you test your software to make sure that it can scale without denting your profits? Fortunately, you can set up a test lab easily and reasonably cheaply to spot bottlenecks and budget for the cloud provision.

Many of us select cloud computing providers due to elasticity: the ability to launch as many servers as needed to meet the demand, and then shut them down as soon as the wave is over. Yet, every launched server has its cost, and if you could handle twice the number of users on each server, your profit margins probably would look better.

How do we know how many users a single server (or the whole system) can handle? How can we spot the bottlenecks and get rid of them? How do we verify that we’ll be able to accommodate the traffic? And finally, how much will we need to pay our cloud provider at the end of the month?

The Traditional Way

A few years ago there were only few options, each of them required deep pockets and major efforts:

1. Building a physical lab with real servers that might be used for other tasks as well.
2. Rent a lab that provides testing facilities. This option requires much less CAPEX, but it requires configuring the lab for your requirements every time, scheduling time slots, and allocating budget for this purpose.

The Cloud changed all that. Today you can set up a cloud-based lab and enjoy the benefits of both dedicated and rented labs with almost no downside. Among the benefits: there are no setup fees, you can launch your lab anytime, you don’t need to commit, and you can save a copy of your lab environment, shut it down, and turn it on when you need it again.

What is the cost? When you don’t use the lab you should pay only for the storage.

The Tools

If you’ve already chosen the cloud, you would be wise to choose open source as well. There are several leading open-source tools such as Apache JMeter that can generate stress at no licensing cost. JMeter supports stress script generation using drag and drop and parameters configuration. It also supports visualization using graphs and reports. Supported protocols include: HTTP/S, SOAP, LDAP, JMS, IMAP and JDBC. JMeter also supports “bot mode”, where several JMeter instances can load a single system and provide a unified reporting.

Getting the Best Prices

After choosing a cloud environment (Amazon AWS currently provides the best offer, but there are many other great players) and a load stress tool (JMeter or others), you’ll want to consider these tips to get more bang for your buck:

1. Windows or Linux: JMeter is Java based. Therefore, it’s platform independent and Linux will be the smart choice.
2. Spot prices: By using spot request, you can save about 60% of your CPU cost, and 30% of the total cost (take a look for a detailed spot saving analysis). Please note that spot prices are variable so you can schedule your tests at times when demand for Amazon web services is low.
3. Use internal IP addresses: Installing both stress loaders and the system in the same Amazon region and using internal IP addresses rather than public ones can help you avoid paying for traffic and cut out a major part of your potential costs.
4. Shut down servers: Shut down your servers when you don’t need them.
5. Create images: If you use 20 servers to create a load, there is no need to save 20 dimmed servers. You may create a single image and launch 20 instances based on it.

Bottom Line

In the cloud era you can expect the unexpected: many users in a short time. Fortunately, the cloud lets you easily install a test environment and launch many load servers to verify the software system that you developed. And the cost? Only a fraction of what we were used to only few years ago.

Keep Performing,

Moshe Kaplan