存储架构

Load Test Your Architecture Before Your Users Do it for You

微信扫一扫,分享到朋友圈

Load Test Your Architecture Before Your Users Do it for You
0

Do you happen to host your own website or application? If so, have you load tested your architecture? I hope the answer is yes…

I happen to host applications for myself as well as my customers. As the traffic to my servers started increasing, I began to wonder — how much traffic can my architecture handle? Then naturally the worst came to mind: what if I got a spike of traffic tomorrow and users couldn’t access their services? The reputation of my service would be tarnished! This kept me up at night for a couple of days until I decided to do something about it.

I made a decision to load test my systems and figure out how many simultaneous users my server can handle. Deciding on something and doing it are two completely different things. I have never done a load test before, therefore, I had a lot to figure out before I could put my servers to the test. Read on to find out how I went about load testing my web applications for the first time and how I can sleep peacefully again. 

Hello Locust

I found multiple tools to load test websites:

  • Paid online tools
  • Selenium
  • JMeter
  • Locust

Out of them all, Locust ( https://locust.io ) caught my attention and stood out. It’s free, open source and written in Python! 

Here’s a brief entry from it’s manifest:

“Locust is an easy-to-use, distributed, user load testing tool. It is intended for load-testing web sites (or other systems) and figuring out how many concurrent users a system can handle.

… Locust is completely event-based, and therefore it’s possible to support thousands of concurrent users on a single machine.”

After briefly reviewing the documentation I had my mind made up and couldn’t wait to get my hands on it. I followed the installation instructions, downloaded PyCharm CE, and was ready to go.

All I had to do is set the number of concurrent users I wanted to simulate along with the hatch rate.

Once you start swarming your system, Locust will present you with some important statistics regarding the performance of your servers. The below image represents a genuine test I carried out. It had around 2000 users carrying out an action on the website every 5-9 seconds. In a very short moment I flooded the servers with over 12 thousand requests! That’s using one host, i.e. my MacBook Pro.

Distributed Mode

Locust has another feature that allows us to simulate much bigger number of users using multiple hosts. You can read more here: https://docs.locust.io/en/stable/running-locust-distributed.html

Conclusion

Running load tests on my servers allowed me to understand the upper limits of my architecture and I realized that I’m still far from the breaking point. I can now sleep again.

Make sure you also understand the upper limits of your system and take the responsibility for load testing, before your users do it for you.

阅读原文...

微信扫一扫,分享到朋友圈

Load Test Your Architecture Before Your Users Do it for You
0
DZone

【动点播报】高通苹果达成和解股价飙涨23%微软选择性拒绝销售人脸识别技术

上一篇

7 Skills To Become A Successful Automation Tester In 2019

下一篇

评论已经被关闭。

插入图片

热门分类

往期推荐

Load Test Your Architecture Before Your Users Do it for You

长按储存图像,分享给朋友