# [[GOH 11 - Grafana k6 for WebSockets and infrastructure testing]] [in developer-advocacy](https://youtube.com/live/_V81Xm22l_c) <iframe width="560" height="315" src="https://www.youtube.com/embed/_V81Xm22l_c" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> ## Talking points - Introduce guest: Huzaifa Asif - Who are you? - What do you do? - How long have you been using Grafana/k6? - Why did you choose k6 as a testing tool? - Purposes of k6 - Frontend and backend performance testing (including load, but also database tuning, etc.) - Fault injection - Contract testing - Infrastructure testing: auto-scaling and auto-recovery - WebSockets case study - HTTP is the popular use case, but today we're talking about WebSockets - What are WebSockets? - [Huzaifa's case study](https://huzaifa-asif.notion.site/Performance-Assessment-of-Echo-Server-s-Horizontal-Scalability-using-K6-07e9c5904d844684a7e0620a5b788116?pvs=4) - integrated Redis with sockets and wanted to check the impact on Redis - Infrastructure testing - What is infrastructure testing? - Issues and concerns regarding infrastructure testing - Autoscaling - Screenshare: Huzaifa (how the application auto scales when we run load testing, this helps us test the auto-scaling configuration of infrastructure) - Application auto-recovery - Screenshare: Huzaifa (Run the k6 script of the application without auto-scaling so that the application crashes. Then we verify how the system recovers when it crashes. Does the application need manual intervention or it auto recover?) - Using k6 to Decide Infrastructure Capacity Based on Expected Concurrent Users. - Simulate expected peak concurrent users with k6's constant-vus executor. Monitor system performance and adjust infrastructure based on response times and resource utilization. Iterate until the system reliably handles the anticipated load - Security testing: Distributed test case to mimic DDoS attack - Deploy multiple k6 instances as pods within a Kubernetes cluster to distribute and scale the testing load. This approach leverages Kubernetes' orchestration capabilities, allowing for simulating massive concurrent users from different nodes, and ensuring comprehensive stress testing across distributed systems and regions. Utilize Kubernetes' native services for efficient load balancing, pod management, and monitoring. - How does k6 fit into the overall observability picture? - Integrations with the Grafana Labs stack: Grafana, Prometheus, Tempo, Faro - Screenshare: Huzaifa - k6 Integration with Local Grafana & InfluxDB - https://github.com/Huzaifa-Asif/K6-Local-Testing-With-Grafana-InfluxDB - Outro - If people want to learn more about this topic, where should they go? - Next week, we have a global shutdown day, which means no Grafana Office Hours. - Coming up in an hour: stay tuned for the 100th episode of k6 Office Hours, in which we'll be talking about our favourite features of k6 as well as the our favourite moments during that livestream series. Paul and I will be there, joined by our other DevRel colleagues, Marie Cruz and Leandro Melendez.