2

I am trying to benchmark WebSocket server using WebsocketClient with the thread pool.All of my WebSocket connections are established but after few messages suddenly few of the connections are closing, with 1006 error with reason "WebSocket Read EOF". How should I debug this further? Please suggest some option to benchmark this one.

// Code to start websocket client
WebSocketClient webSocketClient = new WebSocketClient(sec);

webSocketClient.setMaxIdleTimeout(180000);
webSocketClient.setAsyncWriteTimeout(100000);
webSocketClient.setConnectTimeout(600000);
webSocketClient.setMaxTextMessageBufferSize(60*2048);
webSocketClient.setExecutor(Executors.newFixedThreadPool(100));
webSocketClient.start();

// To connect websocket
webSocketClient.connect(new TestSocket(instanceId, sessionId, MAX_CYCLE), new URI(wsURL), new ClientUpgradeRequest());

TestSocket is my WebsocketAdapter instance .

Thanks

Vikram Patil
  • 628
  • 6
  • 20
  • What `wsURL` did you use? Does [this link](https://stackoverflow.com/a/19305172/4906586) help? – Al-un Oct 04 '17 at 07:41
  • It's of format wss://hostname:port/ws . I think the link you have provided is for not connecting but all of my websocket connections were successful but they closed prematurely. – Vikram Patil Oct 04 '17 at 09:54
  • the endpoint you're reaching is connected to the [http port or https port](https://stackoverflow.com/a/46559376/4906586)? – Al-un Oct 04 '17 at 09:56
  • it's https port. Basically, we are using AWS Load Balancer with SSL certificate and internally AWS Load balancer forward to actually websocket server. For each connection, I was able to exchange 3-5 messages before few of them disconnected with above-said error. – Vikram Patil Oct 04 '17 at 10:03
  • Oh I see. By any chance, do you send the same message sequence? I had a similar experience and actually one message in particular made the websocket disconnect ([it was an asynchronicity error](https://stackoverflow.com/q/45486679/4906586)) – Al-un Oct 04 '17 at 14:23
  • Some how it's happening after 1 min of no activity , but idle timeout is set to 3 min – Vikram Patil Oct 09 '17 at 19:07

0 Answers0