Setting up maximum of connections for web

前端 未结 2 1629
独厮守ぢ
独厮守ぢ 2020-12-28 08:56

In JBoss7 we\'ve restricted number of web connections by using this



        
相关标签:
2条回答
  • 2020-12-28 09:26

    Try add under filters definition

    <filters>
        <connection-limit name="limit-connections" max-concurrent-requests="3000" queue-size="100"/>
    </filters>
    

    and then under host or location add (depends on your need)

    <filter-ref name="limit-connections"/>
    

    See a configuration example and Model Reference

    Also take a look in Configuring the Web server Pool: http://www.javacodegeeks.com/2014/01/entering-undertow-web-server.html

    0 讨论(0)
  • 2020-12-28 09:29

    The above comment from Federico Sierra is correct. But in Wildfly 10.x the filter name 'connection-limit' doesn't exist anymore. Instead it is now called 'request-limit'.

    So for Wildfly 10.x add filter reference in the untertow subsystem inside 'server' and 'host' context and the request-limit filter inside the 'filters' context:

    <subsystem xmlns="urn:jboss:domain:undertow:3.1">
    [...]
      <server name="default-server">
      [...]
        <host name="default-host" alias="localhost">
        <location name="/" handler="welcome-content"/>
        [...]
          <filter-ref name="limit-connections"/>
        </host>
      </server>
    [...]
      <filters>
        <response-header name="server-header" header-name="Server" header-value="WildFly/10"/>
        <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
        <request-limit name="limit-connections" max-concurrent-requests="3000" queue-size="100"/>
      </filters>
    </subsystem>
    

    Reference: https://github.com/wildfly/wildfly/blob/master/undertow/src/test/resources/org/wildfly/extension/undertow/undertow-3.1.xml

    0 讨论(0)
提交回复
热议问题