I did a bit of digging and found this article. Haven't tried it myself, but you can give it a shot https://ma.ttias.be/benchmarking-websocket-server-performance-with-artillery/
How to test my Soketi server?
I'm not an expert servers person, so my following setup might be wrong: I setup 3 Ubuntu 20.04 Server virtual machines as follows: (And I'm not sure that's enough for that test either because I'm also using php artisan serve which is using PHP's development server, so not sure it's suitable for the test)
-
192.168.10.10- Soketi Server - 2 Cores, 2GB RAM -
192.168.10.11- Laravel Project Server - 2 Cores, 2GB RAM -
192.168.10.12- Test Server - 1 Core, 1GB RAM
The Soketi server is the one that handles web sockets on 192.168.10.10
The Laravel server has an endpoint on 192.168.10.11/websocket which opens a connection using Laravel Echo, so every time you hit this endpoint, there's an open web socket connection created.
I tried using wrk. I installed it on the Test server and then ran
// using 2 threads, 400 connections for 30 seconds
sudo wrk -t2 -c400 -d30s http://192.168.10.11/websocket
And it does run, I can see the Laravel server getting all these requests, however the number of connections as seen in Soketi metrics stays on 0. So I'm not sure it acts like a real user. (I even tried adding a keep-alive header for the test:
sudo wrk -t2 -c400 -d30s -H "Connection: Keep-Alive" http://192.168.10.11/websocket
But that didn't do anything either.
So I am not sure if it even benchmarks the Soketi server itself or just the Laravel server
I also tried to use the siege package, but it does the same as wrk
Do I have any options left? Also, do I need to configure more stuff for that? Or my current setup is enough for basic measurements
(For example, every tab I open in the browser of the 192.168.10.11/websocket endpoint, shows up as a new connection in the Soketi metrics on 192.168.10.10:9601/metrics)
Just an idea. Open the browser on a page with echo. Open developer tools - > network and set it to ws. Now refresh, and copy the exact url that shows up and use it in artillery
Please or to participate in this conversation.