Websocket: constant throughput of >= 100 msg/sec per user

23 views
Skip to first unread message

David Leonhartsberger

unread,
Jan 14, 2017, 7:19:33 AM1/14/17
to Gatling User Group
Hi,

I am trying to make a simple ping/pong load test, just for experimental purposes.

I would like to have at least 100 msg/sec per user, so I need to send 1 request every 10 msec.
This is what I have come up so far:

val echo = scenario("echo")
 
.exec(ws("Connect WS").open("/"))
 
.pause(1 second)
 
.repeat(5000, "i") {
   
exec(ws("Ping/Pong")
       
.sendText("ping")
       
.check(wsListen.within(10 milliseconds).until(1).regex("pong")))
 
} // .pace(10 milliseconds) should i do pace here?
 
.pause(1 second)
 
.exec(ws("Close WS").close)

setUp
(echo.inject(atOnceUsers(1))).protocols(wsConf)


But the results show me only 452-285=~180 msg per sec.

================================================================================
2017-01-14 13:14:49                                          10s elapsed
---- Requests ------------------------------------------------------------------
> Global                                                   (OK=566    KO=5     )
> Connect WS                                               (OK=1      KO=0     )
> Ping/Pong                                                (OK=285    KO=0     )
> Ping/Pong Check                                          (OK=280    KO=5     )
---- Errors --------------------------------------------------------------------
> Check didn't succeed by the time a new one was set up               5 (100.0%)

---- echo ----------------------------------------------------------------------
[--------------------------------------------------------------------------]  0%
          waiting: 0      / active: 1      / done:0    
================================================================================


================================================================================
2017-01-14 13:14:54                                          15s elapsed
---- Requests ------------------------------------------------------------------
> Global                                                   (OK=900    KO=5     )
> Connect WS                                               (OK=1      KO=0     )
> Ping/Pong                                                (OK=452    KO=0     )
> Ping/Pong Check                                          (OK=447    KO=5     )
---- Errors --------------------------------------------------------------------
> Check didn't succeed by the time a new one was set up               5 (100.0%)

---- echo ----------------------------------------------------------------------
[--------------------------------------------------------------------------]  0%
          waiting: 0      / active: 1      / done:0    
================================================================================

Even if I reduce the wsListen timeout or the pace to 5 millis, the throughput does not increase.

How do I get a constant throughput of >= 100 msg/sec on a single connection?

Br,
David
Reply all
Reply to author
Forward
0 new messages