開源的負載測試工具:locust
locust是一個采用Python開發的負載測試工具。使用Python代碼定義用戶行為,然后模擬數百萬用戶同時使用系統。
特性
-
Write user test scenarios in plain-old Python
No need for clunky UIs or bloated XML, just code as you normally would. Based on coroutines instead of callbacks (aka boomerang code) allows code to look and behave like normal, blocking Python code. -
Distributed & Scalable - supports hundreds of thousands of users
Locust supports running load tests distributed over multiple machines. Being event based, even one Locust node can handle thousands of users in a single process. Part of the reason behind this is that even if you simulate that many users, not all are actively hitting your system. Often, users are idle figuring out what to do next. Request per second != number of users online. -
Web-based UI
Locust has a neat HTML+JS that shows all relevent test details in real-time. And since the UI is web-based, it's cross-platform and easily extendable. -
Can test any system
Even though Locust is web-oriented, it can be used to test almost any system. Just write a client for what ever you wish to test and swarm it with locusts! It's super easy! -
Hackable
Locust is very small and very hackable and we intend to keep it that way. All heavy-lifting of evented I/O and coroutines are delegated to gevent. The brittleness of alternative testing tools was the reason we created Locust.
官網:http://locust.io/
github主頁:https://github.com/locustio/locust