title: How to increase the max connections, streams and threads in Wildfly?
body: <p>I'm building a notification system which allows clients to connect to a web-server and then get notified by server side events. I currently use Wildfly 16.0 standalone (on Windows) as web-server. I got server side events working with the example code below.</p>
  
  <pre><code>@GET
  @Path("register")
  @Produces("text/event-stream")
  public void subscribe(@Context SseEventSink sseEventSink,
                        @HeaderParam(HttpHeaders.LAST_EVENT_ID_HEADER)) {
  
      while (true) {
  
          OutboundSseEvent sseEvent = this.eventBuilder
                  .data("some data")
                  .reconnectDelay(3000)
                  .build();
          CompletionStage&lt;?&gt; cs = sseEventSink.send(sseEvent);
  
          cs.whenComplete((x, y) -&gt; {
              System.out.println("Completed " + x);
              if (y != null) y.printStackTrace();
          });
  
  
          Thread.sleep(5 * 1000);
  
      }
      sseEventSink.close();
  }
  </code></pre>
  
  <p>This solution is working for up to 120 connected clients with minimal server load, after that no new connections can be established. </p>
  
  <p>I use ApacheBench, Version 2.3 for testing. </p>
  
  <pre><code>    ab -A 123:123 -c 120 -n 120 http://127.0.0.1:8080/
  </code></pre>
  
  <p>If i go higher than 120 concurrent connections no one else can connect. This seems to me, that there is an active connection or stream or thread limit in place. If one user disconnects, another than can connect. I tried to set max-connections on the http-listener in the standalone.xml. This had no effect. I than simply added a zero to every connection / thread / pool option i could find. Still, no change.</p>
  
  <p>Where to look next?</p>