Pycon Korea 2015 - Load Testing with Locust.io
-
Upload
robert-jerovsek -
Category
Software
-
view
401 -
download
0
Transcript of Pycon Korea 2015 - Load Testing with Locust.io
![Page 2: Pycon Korea 2015 - Load Testing with Locust.io](https://reader034.fdocuments.in/reader034/viewer/2022052318/586e120b1a28ab8a588b596f/html5/thumbnails/2.jpg)
Locust.io
• Open Source Python tool for Load Testing!• Simple!• Scalable
![Page 3: Pycon Korea 2015 - Load Testing with Locust.io](https://reader034.fdocuments.in/reader034/viewer/2022052318/586e120b1a28ab8a588b596f/html5/thumbnails/3.jpg)
Locust.io
• Python 2.6+!• Python 3.x WIP (due to reliance on Gevent)!• No graphs out of the box (does only one thing well :))
![Page 4: Pycon Korea 2015 - Load Testing with Locust.io](https://reader034.fdocuments.in/reader034/viewer/2022052318/586e120b1a28ab8a588b596f/html5/thumbnails/4.jpg)
New Relic
• Monitor performance and load!• See bottlenecks!• Detect regressions
![Page 5: Pycon Korea 2015 - Load Testing with Locust.io](https://reader034.fdocuments.in/reader034/viewer/2022052318/586e120b1a28ab8a588b596f/html5/thumbnails/5.jpg)
New Relic
• Everything in “the cloud”!• No local version!• Delay in data
![Page 6: Pycon Korea 2015 - Load Testing with Locust.io](https://reader034.fdocuments.in/reader034/viewer/2022052318/586e120b1a28ab8a588b596f/html5/thumbnails/6.jpg)
Code!
https://github.com/robertjerovsek/pycon-kr-2015
![Page 7: Pycon Korea 2015 - Load Testing with Locust.io](https://reader034.fdocuments.in/reader034/viewer/2022052318/586e120b1a28ab8a588b596f/html5/thumbnails/7.jpg)
Reasons - Capacity planning
• Can we handle 2/4/10x the traffic/users/orders?!• What do we need to handle that?!• When no “autoscaling” available
![Page 8: Pycon Korea 2015 - Load Testing with Locust.io](https://reader034.fdocuments.in/reader034/viewer/2022052318/586e120b1a28ab8a588b596f/html5/thumbnails/8.jpg)
Reasons - Bottlenecks
• Connection limits!• Locking issues!• CPU, IO, Memory!• Network congestion
![Page 9: Pycon Korea 2015 - Load Testing with Locust.io](https://reader034.fdocuments.in/reader034/viewer/2022052318/586e120b1a28ab8a588b596f/html5/thumbnails/9.jpg)
Reasons
• Reducing operational costs (wasted resources)!• Better performance!• Peaceful mind (no alarms)
![Page 10: Pycon Korea 2015 - Load Testing with Locust.io](https://reader034.fdocuments.in/reader034/viewer/2022052318/586e120b1a28ab8a588b596f/html5/thumbnails/10.jpg)
Reasons - Happy hamsters :)
![Page 11: Pycon Korea 2015 - Load Testing with Locust.io](https://reader034.fdocuments.in/reader034/viewer/2022052318/586e120b1a28ab8a588b596f/html5/thumbnails/11.jpg)
Solutions - More servers
• Frontend servers!• Database slaves!• Workers
![Page 12: Pycon Korea 2015 - Load Testing with Locust.io](https://reader034.fdocuments.in/reader034/viewer/2022052318/586e120b1a28ab8a588b596f/html5/thumbnails/12.jpg)
Solutions
• Caching!– old data visible to the user = bad UX!
• Reducing connections to the database, external services!• Pre-calculating results!• Background tasks!– slow change propagation = bad UX!
• Distribute (slaves, sharding, …)
![Page 13: Pycon Korea 2015 - Load Testing with Locust.io](https://reader034.fdocuments.in/reader034/viewer/2022052318/586e120b1a28ab8a588b596f/html5/thumbnails/13.jpg)
When to load test?
• Always :)!• Before and after releases!• Simple with Locust
![Page 14: Pycon Korea 2015 - Load Testing with Locust.io](https://reader034.fdocuments.in/reader034/viewer/2022052318/586e120b1a28ab8a588b596f/html5/thumbnails/14.jpg)