Load Test
According to a benchmark made by Glory4Gamers, the open source version of the Mercure.rocks hub is able to 40k concurrent connections on a single EC2 t3.micro instance. It's even possible to handle way more connections by using the HA version of the Mercure.rocks Hub.
To test your own infrastructure, we provide a Gatling-based load test. It allows to test any implementation of the protocol, including the open source Hub.
Running the Load Test
Clone the Mercure repository:
git clone https://github.com/dunglas/mercureGo to the
gatlingdirectory:cd gatlingRun
./mvnw gatling:test
Configuration
Available environment variables (all are optional):
HUB_URL: the URL of the hub to testJWT: the JWT to use for authenticating publishersSUBSCRIBER_JWT: the JWT to use for authenticating subscribers, fallbacks toJWTnot set andPRIVATE_UPDATESsetINITIAL_SUBSCRIBERS: the number of concurrent subscribers initially connectedSUBSCRIBERS_RATE_FROM: minimum rate (per second) of additional subscribers to connectSUBSCRIBERS_RATE_TO: maximum rate (per second) of additional subscribers to connectPUBLISHERS_RATE_FROM: minimum rate (per second) of publicationsPUBLISHERS_RATE_TO: maximum rate (per second) of publicationsINJECTION_DURATION: duration of the publishers injectionCONNECTION_DURATION: duration of subscribers' connectionRANDOM_CONNECTION_DURATION: to randomize the connection duration (will longsCONNECTION_DURATIONat max)PRIVATE_UPDATES: to send private updates with random topics instead of public updates always with the same topic