
At Physics Wallah, our commitment to delivering seamless educational experiences requires robust and scalable infrastructure. In Part 1, we shared our journey of revamping our load testing approach by leveraging Kubernetes. Today, we’re excited to share how we’ve further evolved this strategy to overcome new challenges and achieve even greater efficiency.
While Kubernetes provided significant advantages, such as automated scaling and better resource control, we encountered several issues:
To address these challenges, we transitioned our load testing setup from Kubernetes to EC2 machines. Here’s a breakdown of the benefits this shift brought:

Tuning for Optimal Performance
To maximize the efficiency of our new setup, we’ve implemented several performance tuning measures on our EC2 instances:
Increased Local Port Range:
echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range
This command increases the range of available local ports, allowing more connections to be handled simultaneously.
Fast Recycling TIME_WAIT Sockets:
sudo sysctl -w net.ipv4.tcp_tw_recycle=1
Enabling fast recycling of TIME_WAIT sockets helps in quickly reclaiming socket resources.
Reuse of Sockets:
sudo sysctl -w net.ipv4.tcp_tw_reuse=1
Enabling reuse of sockets ensures efficient utilization of available socket connections.
One critical issue we faced in our Kubernetes setup was the discrepancy between JMeter-reported API latency and what was observed via our APM tools. JMeter’s high ‘Connect Time’ skewed the latency results, giving a misleading picture of API performance. Due to port exhaustion and network congestion, the ‘Connect Time’ in JMeter reports was significantly higher.
By moving to EC2, where we have more control over network configurations and resource allocation, we’ve mitigated these discrepancies. Running one JMeter instance per node and fine-tuning the network configuration has reduced the ‘Connect Time’ to under 3 milliseconds. This alignment means our JMeter reports now accurately reflect the data shown in our APM tools, providing a true picture of our API performance.
Our transition from Kubernetes to EC2 has proven to be a game-changer. By addressing the limitations of our previous setup, we’ve achieved a more stable, efficient, and scalable load testing environment. This evolution underscores our dedication to continuously improving our infrastructure to support our mission of providing quality education to all.
As we move forward, we will continue to explore and implement innovative solutions to ensure our systems remain robust and capable of handling the growing demands of our platform.
Stay tuned for more insights as we continue to refine our processes and share our learnings with the community.
#EdTech #LoadTesting #Scalability #AWS #EC2 #PerformanceOptimization #PhysicsWallah
Feel free to reach out if you have any questions or would like to learn more about our load testing journey!
