Showing posts from June, 2018

Polling vs WebSockets - Part 2 - Stress Testing

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 ThreadsJob duration 0-10 seconds40 Threads/Users - Instant ramp upEach Thread creating 10 jobsPolling interval of 500msTimeout: 11 seconds Results - Some Errors from WebSocket implementationRun 1Polling - 0 errorsWebSockets - 0 errorsRun 2Polling - 0 errorsWebSockets - 2 errorsRun 3Polling - 0 errorsWebSockets - 0 errors