Posts

Showing posts from June, 2018

Polling vs WebSockets - Part 2 - Stress Testing

Image
In my previous blog post, I discussed the efficiency of polling compared to WebSockets  for a web application.  Using these two different implementations and performance tests, I decided it would be interesting to perform some stress testing to see which solution can handle the most load. All code on github here .  For details of the original problem and performance tests, see here Let's increase the threads until it fails Even with a low number of threads, occasionally I would encounter errors - most likely soon after the server had started in its new Docker container.  Therefore I decided to run each scenario three times and display all results. Scenario - 40 Threads Job duration 0-10 seconds 40 Threads/Users - Instant ramp up Each Thread creating 10 jobs Polling interval of 500ms Timeout: 11 seconds Results - Some Errors from WebSocket implementation Run 1 Polling - 0 errors WebSockets - 0 errors Run 2 Polling - 0 errors WebSockets - 2 errors