![]() ![]() #Squeeze test codeDeveloping artificial traffic is easy at first, but you quickly end up with lots of code to model all the possible uses of your system. It can be easy to get started writing artificial traffic, but the issue is typically covering all of your test cases. Artificial TrafficĪrtificial traffic is generated programmatically. This can be done with an extra field that basically says “replay:true” or you can do replay tests in a beta environment that is distinct from production. You do need a way to flag replay traffic to ensure it doesn’t actually change customer accounts or place orders. Replay traffic is when you record actual customer requests and then replay them later to load test your services. At bigger scales squeeze tests are very effective for evaluating how much a host can handle. Thats great if you need 3 hosts to serve 100 req/s but if one host can handle 200 req/s a squeeze test doesn’t help. If you have 100req/s natural traffic a squeeze test will only allow you to test 100 req/s on a single host. The last limitation is that you are limited in how much load you can put onto that host by your current natural traffic. This only works if you run a multi-host system and has the risk that you cause an outage for actual customers. You modify your load balancer to gradually route all of your traffic to a single host. Squeeze testsĪ squeeze test is a way to use natural traffic to load test your services. Do you really want to use customers to test if your service works with 10x as many users? No, because that is expensive and you’d rather have those customers buy things on a working site. If you have non-peak load of 100 req/s (requests per second) in a load test you are typically preparing for a situation where you get 1000 req/s. The issue with natural traffic is that it cannot be scaled easily. This traffic is great for testing your service because it is a 100% real example of your load. Natural traffic is real traffic generated by customers who want to use your project. Developing synthetic traffic is pretty expensive, but it is also easy, you just write some code and prepare some test accounts. This is called synthetic traffic, its typically very predictable or targets a subset of the systems functionality. An easy way to do it is to write a script that makes request to our website. If we want to load test in preparation for a 10x peak of traffic during a sale, we need to get 10x our regular traffic from somewhere. When we load test the traffic has to come from somewhere. This helps us decide how much hardware we need, whether we need to switch to a more performant architecture, and prepare for a peak event like a big sale. Load testing helps us estimate how much load our system can handle. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |