From boggard at hotmail.com Fri Feb 2 03:26:00 2018 From: boggard at hotmail.com (Fernando Cruz) Date: Fri, 2 Feb 2018 08:26:00 +0000 Subject: [undertow-dev] Path variables Message-ID: Hi, I define two template paths with the following implementation: public class UndertowTwoPathVariablesApplication { private static final Logger LOGGER = LoggerFactory.getLogger(UndertowTwoPathVariablesApplication.class); public static void main(final String[] args) { Undertow.builder() .addHttpListener(8080, "localhost") .setHandler( Handlers.routing() .get("/api/v1/orders/{orderId}/items/", (exchange) -> { LOGGER.info("The path template defined is '/api/v1/orders/{orderId}/items/'"); LOGGER.info("The request URI '{}'", exchange.getRequestURI()); exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/plain"); exchange.setStatusCode(StatusCodes.OK) .getResponseSender().send("Retrieve all Items of the Order '" + exchange.getQueryParameters().get("orderId").getLast() + "'"); }) .get("/api/v1/orders/{orderId}/items/{itemId}", (exchange) -> { LOGGER.info("The path template defined is '/api/v1/orders/{orderId}/items/{itemId}'"); LOGGER.info("The request URI '{}'", exchange.getRequestURI()); exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/plain"); exchange.setStatusCode(StatusCodes.OK) .getResponseSender().send( "Retrieve the Item '" + exchange.getQueryParameters().get("itemId").getLast() + "' of the Order '" + exchange.getQueryParameters().get("orderId").getLast() + "'"); })) .build() .start(); } } And using the version 2.0.0.Beta1 of undertow-core I can not enter to the first Handler defined. boggard at xiuhcoatl:~$ curl -v 'http://localhost:8080/api/v1/orders/12345/items' * Trying 127.0.0.1... * TCP_NODELAY set * Connected to localhost (127.0.0.1) port 8080 (#0) > GET /api/v1/orders/12345/items HTTP/1.1 > Host: localhost:8080 > User-Agent: curl/7.58.0 > Accept: */* > < HTTP/1.1 404 Not Found < Connection: keep-alive < Content-Length: 0 < Date: Fri, 02 Feb 2018 08:08:48 GMT < * Connection #0 to host localhost left intact boggard at xiuhcoatl:~$ curl -v 'http://localhost:8080/api/v1/orders/12345/items/' * Trying 127.0.0.1... * TCP_NODELAY set * Connected to localhost (127.0.0.1) port 8080 (#0) > GET /api/v1/orders/12345/items/ HTTP/1.1 > Host: localhost:8080 > User-Agent: curl/7.58.0 > Accept: */* > < HTTP/1.1 200 OK < Connection: keep-alive < Content-Type: text/plain < Content-Length: 41 < Date: Fri, 02 Feb 2018 08:09:15 GMT < * Connection #0 to host localhost left intact Retrieve the Item '' of the Order '12345' boggard at xiuhcoatl:~$ curl -v 'http://localhost:8080/api/v1/orders/12345/items/' * Trying 127.0.0.1... * TCP_NODELAY set * Connected to localhost (127.0.0.1) port 8080 (#0) > GET /api/v1/orders/12345/items/ HTTP/1.1 > Host: localhost:8080 > User-Agent: curl/7.58.0 > Accept: */* > < HTTP/1.1 200 OK < Connection: keep-alive < Content-Type: text/plain < Content-Length: 41 < Date: Fri, 02 Feb 2018 08:09:15 GMT < * Connection #0 to host localhost left intact Retrieve the Item '' of the Order '12345' This not happen when the path have just one path variable. I create the repo https://github.com/b0gg4rd/undertow-path-variable with the two implementations. Best Regards Fernando Cruz -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180202/f27d2277/attachment.html From jernst at indiecomputing.com Tue Feb 6 15:06:12 2018 From: jernst at indiecomputing.com (Johannes Ernst) Date: Tue, 6 Feb 2018 12:06:12 -0800 Subject: [undertow-dev] Serving files in a different hierarchy than the one in the file system Message-ID: I?m attempting to serve a bunch of static files, which exist in the file system, but in various directories that do not correspond to the URL namespace. Example: http://example.com/foo/one => /var/lib/one/bar http://example.com/foo/two => /var/lib/two/bar I have the mapping from incoming request URL to File to be served in a Map. Now I?m attempting to hook up Undertow so it can serve those files according to my mapping, and I?m not entirely sure where to best plug this in without having to write loads of code. As far as I can tell, I would need to implement my version of ResourceManager and Resource, sort of like File/PathResource/Manager, but there?s a lot of code there, not all of which I understand, and it would perhaps turn into a maintenance nightmare on my end. I cannot see a straightforward way of overriding those classes either to ?slide in? an alternate mapping. Is there a better way of doing this? Thanks, Johannes. From sdouglas at redhat.com Tue Feb 6 19:01:20 2018 From: sdouglas at redhat.com (Stuart Douglas) Date: Wed, 7 Feb 2018 01:01:20 +0100 Subject: [undertow-dev] Serving files in a different hierarchy than the one in the file system In-Reply-To: References: Message-ID: You could possibly use io.undertow.server.handlers.resource.ResourceSupplier, and then use PathResourceManager under the hood to actually return a path resource. If all these files have a common root path you could basically create a PathResourceManager that maps to this, and then use Map in the supplier. Stuart On Tue, Feb 6, 2018 at 9:06 PM, Johannes Ernst wrote: > I?m attempting to serve a bunch of static files, which exist in the file > system, but in various directories that do not correspond to the URL > namespace. Example: > > http://example.com/foo/one => /var/lib/one/bar > http://example.com/foo/two => /var/lib/two/bar > > I have the mapping from incoming request URL to File to be served in a > Map. Now I?m attempting to hook up Undertow so it can serve > those files according to my mapping, and I?m not entirely sure where to > best plug this in without having to write loads of code. > > As far as I can tell, I would need to implement my version of > ResourceManager and Resource, sort of like File/PathResource/Manager, but > there?s a lot of code there, not all of which I understand, and it would > perhaps turn into a maintenance nightmare on my end. > > I cannot see a straightforward way of overriding those classes either to > ?slide in? an alternate mapping. > > Is there a better way of doing this? > > Thanks, > > > > Johannes. > > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180207/98ffe891/attachment.html From jernst at indiecomputing.com Tue Feb 6 20:13:24 2018 From: jernst at indiecomputing.com (Johannes Ernst) Date: Tue, 6 Feb 2018 17:13:24 -0800 Subject: [undertow-dev] Serving files in a different hierarchy than the one in the file system In-Reply-To: References: Message-ID: <3EA51629-E6CE-4896-8CA9-00BC180FB706@indiecomputing.com> I appreciate the suggestion, but that sounded a bit indirect ? Instead I copied File/PathResource/Manager into new classes MappedPathResource/Manager, ripped out all the things that aren?t relevant in this case (like symlink support, case sensitivity, and watching the file system). The result is simpler than expected: the Resource class is basically identical to PathResource (minus pointer type back to the manager), and the new MappedPathResourceManager is just 150 lines or so. Here?s how to use it: Map mappings = new HashMap<>(); // insert some test data mappings.put( "/foo", Paths.get( System.getProperty("user.home") + "/.bashrc" )); Undertow server = Undertow.builder() .addHttpListener(8080, "localhost") .setHandler( new ResourceHandler( new MappedPathResourceManager( mappings ))) .build(); server.start(); and it seems to work and serve my purposes. Code is here: https://github.com/jernst/undertow-mappedpathresource Q: Is that something that would be of use to anybody else? If so, I?d be happy to clean up the code and submit a PR. P.S Ideally a bit a refactoring should be done so that PathResource and MappedPathResource share the same code (all these inner classes and threaded-related behavior) but that would require some kind of intermediate superclass that collects functionality common to PathResourceManager and MappedPathResourceManager. P.S.2: I like Undertow. Give what kind of $%*&WQ@)$^& web servers there are in Java land ? Cheers, Johannes. > On Feb 6, 2018, at 16:01, Stuart Douglas wrote: > > You could possibly use io.undertow.server.handlers.resource.ResourceSupplier, and then use PathResourceManager under the hood to actually return a path resource. If all these files have a common root path you could basically create a PathResourceManager that maps to this, and then use Map in the supplier. > > Stuart > > On Tue, Feb 6, 2018 at 9:06 PM, Johannes Ernst > wrote: > I?m attempting to serve a bunch of static files, which exist in the file system, but in various directories that do not correspond to the URL namespace. Example: > > http://example.com/foo/one => /var/lib/one/bar > http://example.com/foo/two => /var/lib/two/bar > > I have the mapping from incoming request URL to File to be served in a Map. Now I?m attempting to hook up Undertow so it can serve those files according to my mapping, and I?m not entirely sure where to best plug this in without having to write loads of code. > > As far as I can tell, I would need to implement my version of ResourceManager and Resource, sort of like File/PathResource/Manager, but there?s a lot of code there, not all of which I understand, and it would perhaps turn into a maintenance nightmare on my end. > > I cannot see a straightforward way of overriding those classes either to ?slide in? an alternate mapping. > > Is there a better way of doing this? > > Thanks, > > > > Johannes. > > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180206/4d9b0c7d/attachment-0001.html From nimtiazm at gmail.com Sat Feb 10 20:08:37 2018 From: nimtiazm at gmail.com (Nabeel Imtiaz) Date: Sun, 11 Feb 2018 05:08:37 +0400 Subject: [undertow-dev] Undertow Java 9 compatibility Message-ID: Hi, Is version 1.4.22.Final compatible with Java 9? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180211/dc78cf3d/attachment.html From sdouglas at redhat.com Sun Feb 11 17:34:43 2018 From: sdouglas at redhat.com (Stuart Douglas) Date: Sun, 11 Feb 2018 23:34:43 +0100 Subject: [undertow-dev] Undertow Java 9 compatibility In-Reply-To: References: Message-ID: Yes, although there are still some known issues with running in a modular environment (namely that the Servlet API jar file name is not compatible with the automatic module name algorithm, this will be fixed shortly). If you run into any issues please report them on JIRA. Stuart On Sun, Feb 11, 2018 at 2:08 AM, Nabeel Imtiaz wrote: > Hi, > > Is version 1.4.22.Final compatible with Java 9? > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180211/b454e8ae/attachment.html From tcerar at redhat.com Mon Feb 12 04:22:35 2018 From: tcerar at redhat.com (Tomaz Cerar) Date: Mon, 12 Feb 2018 10:22:35 +0100 Subject: [undertow-dev] Undertow Java 9 compatibility In-Reply-To: References: Message-ID: As long as you work in classpath mode everything should be fine. But if you run in modular enviroment, and see any issues let us know. servlet-api 3.1 spec jar was fixed to work in modular path in version 1.0.2.Final so you might specify exact version if you run into issues. -- tomaz On Sun, Feb 11, 2018 at 11:34 PM, Stuart Douglas wrote: > Yes, although there are still some known issues with running in a modular > environment (namely that the Servlet API jar file name is not compatible > with the automatic module name algorithm, this will be fixed shortly). > > If you run into any issues please report them on JIRA. > > Stuart > > On Sun, Feb 11, 2018 at 2:08 AM, Nabeel Imtiaz wrote: > >> Hi, >> >> Is version 1.4.22.Final compatible with Java 9? >> >> _______________________________________________ >> undertow-dev mailing list >> undertow-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/undertow-dev >> > > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180212/244d1795/attachment.html From nimtiazm at gmail.com Tue Feb 13 00:43:16 2018 From: nimtiazm at gmail.com (Nabeel Imtiaz) Date: Tue, 13 Feb 2018 09:43:16 +0400 Subject: [undertow-dev] Undertow Java 9 compatibility In-Reply-To: References: Message-ID: I tried version 1.4.22.Final with classpath mode and it seems to have been working fine so far. No sun.misc.Cleaner exceptions like I used to receive in 1.4.20.Final. On Mon, Feb 12, 2018 at 1:22 PM, Tomaz Cerar wrote: > As long as you work in classpath mode everything should be fine. > > But if you run in modular enviroment, and see any issues let us know. > > servlet-api 3.1 spec jar was fixed to work in modular path in version > 1.0.2.Final > so you might specify exact version if you run into issues. > > -- > tomaz > > On Sun, Feb 11, 2018 at 11:34 PM, Stuart Douglas > wrote: > >> Yes, although there are still some known issues with running in a modular >> environment (namely that the Servlet API jar file name is not compatible >> with the automatic module name algorithm, this will be fixed shortly). >> >> If you run into any issues please report them on JIRA. >> >> Stuart >> >> On Sun, Feb 11, 2018 at 2:08 AM, Nabeel Imtiaz >> wrote: >> >>> Hi, >>> >>> Is version 1.4.22.Final compatible with Java 9? >>> >>> _______________________________________________ >>> undertow-dev mailing list >>> undertow-dev at lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/undertow-dev >>> >> >> >> _______________________________________________ >> undertow-dev mailing list >> undertow-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/undertow-dev >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180213/3b492330/attachment.html From paroczizs at gmail.com Tue Feb 13 11:18:44 2018 From: paroczizs at gmail.com (paroczizs .) Date: Tue, 13 Feb 2018 17:18:44 +0100 Subject: [undertow-dev] LoadBalancingProxyClient URI mapping Message-ID: Hi undertow Dev! I would like to use the LoadBalancingProxyClient from a custom handler and forward the request to a different server and different URI. The server is set up this way: LoadBalancingProxyClient lb = .. lb.addHost(new URI("http://localhost:5001/other-app/service1")); The handler is mapped like this path = /my-server/serv-one In the log I found this: DEBUG [io.undertow.server.handlers.proxy] (default I/O-2) Sending request ClientRequest{path='/other-app/service1/my-server/serv-one', method=GET, protocol=HTTP/1.1} .. Regards, Zsolt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180213/29834519/attachment.html From paroczizs at gmail.com Tue Feb 13 17:15:45 2018 From: paroczizs at gmail.com (paroczizs .) Date: Tue, 13 Feb 2018 23:15:45 +0100 Subject: [undertow-dev] Wildfly 11 + ReverseProxy + 2 was ssl Message-ID: Hi UndertowDev, Is it possible to configure 2 way ssl with reverse proxy in wildfly standalone.xml? The schema and the realm set properly in case of 1 way ssl works fine however when the back end requests for the client cert the wildfly does not sent it: 22:12:41,187 INFO [stdout] (default task-2) *** CertificateRequest ... 22:12:41,213 INFO [stdout] (default task-2) Warning: no suitable certificate found - continuing without client authentication realm looks like this: Another question whether is basic authentication possible from the configuration? Thank you in advance, Zsolt Mentes a v?rusokt?l. www.avast.com <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180213/b19e1f4d/attachment-0001.html From sdouglas at redhat.com Tue Feb 13 18:38:23 2018 From: sdouglas at redhat.com (Stuart Douglas) Date: Wed, 14 Feb 2018 10:38:23 +1100 Subject: [undertow-dev] Wildfly 11 + ReverseProxy + 2 was ssl In-Reply-To: References: Message-ID: You need to configure client cert auth as being required on the front end server, and then enable certificate-forwarding on the back end server. The front end will encode the certificate into a header, which will be decoded by the back end server. Stuart On Wed, Feb 14, 2018 at 9:15 AM, paroczizs . wrote: > Hi UndertowDev, > > Is it possible to configure 2 way ssl with reverse proxy in wildfly > standalone.xml? > The schema and the realm set properly in case of 1 way ssl works fine > however when the back end requests for the client cert the wildfly does not > sent it: > > 22:12:41,187 INFO [stdout] (default task-2) *** CertificateRequest > > ... > > 22:12:41,213 INFO [stdout] (default task-2) Warning: no suitable > certificate found - continuing without client authentication > > > > > realm looks like this: > > > > > > > > keystore-password="123456" alias="pserver" key-password="123456"/> > > > > > > > > keystore-password="123456"/> > > > > > > > Another question whether is basic authentication possible from the > configuration? > > Thank you in advance, Zsolt > > > Mentes > a v?rusokt?l. www.avast.com > > <#m_-7227769160674502977_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180214/e4c1eefd/attachment.html From sdouglas at redhat.com Tue Feb 13 18:50:22 2018 From: sdouglas at redhat.com (Stuart Douglas) Date: Wed, 14 Feb 2018 10:50:22 +1100 Subject: [undertow-dev] LoadBalancingProxyClient URI mapping In-Reply-To: References: Message-ID: I am not really sure exactly what your question is? What are you trying to achieve compared to what is actually happening? Stuart On Wed, Feb 14, 2018 at 3:18 AM, paroczizs . wrote: > Hi undertow Dev! > > I would like to use the LoadBalancingProxyClient from a custom handler and > forward the request to a different server and different URI. > > The server is set up this way: > > LoadBalancingProxyClient lb = .. > lb.addHost(new URI("http://localhost:5001/other-app/service1")); > > The handler is mapped like this > > path = /my-server/serv-one > > > In the log I found this: > > DEBUG [io.undertow.server.handlers.proxy] (default I/O-2) Sending request > ClientRequest{path='/other-app/service1/my-server/serv-one', method=GET, > protocol=HTTP/1.1} .. > > Regards, Zsolt > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180214/763684b5/attachment.html From bdw429s at gmail.com Thu Feb 22 00:04:48 2018 From: bdw429s at gmail.com (Brad Wood) Date: Wed, 21 Feb 2018 23:04:48 -0600 Subject: [undertow-dev] Worker thread queue size and timeout behavior Message-ID: I'm looking for a bit of understanding on just how Undertow handles large numbers of requests coming into a server. Specifically when more requests are being sent in than are being completed. I've been doing some load testing on a CFML app (Lucee Server) where I happen to have my io-threads set to 4 and my worker-threads set to 150. I'm using a monitoring tool (FusionReactor) that shows me the number of currently executing threads at my app and under heavy load I see exact 150 running HTTP threads in my app server, which makes sense since I have 150 worker threads. I'm assuming here that I can't simultaneously process more requests than I have worker threads (please correct if I'm off there) So assuming I'm thinking that through correctly, what happens to additional requests that are coming into the server at that point? I assume they are being queued somewhere, but - What is this queue? - How do I monitor it? - How big can it get? - Where do I change the size? - How long do things stay in there before sending back an error to the HTTP client? - Can I control what error comes back to the HTTP client in that scenario? - If I'm using an HTTP/S and AJP listener, do they all share the same settings? Do they share the same queues? I've done a bit of Googling and reviewed some docs but haven't quite found any definitive information on this, and a lot of info I found was about Wildfly specifically so I wasn't sure how much of it applied. Thanks! ~Brad *Developer Advocate* *Ortus Solutions, Corp * E-mail: brad at coldbox.org ColdBox Platform: http://www.coldbox.org Blog: http://www.codersrevolution.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180221/a718fcc0/attachment.html From bill at dartalley.com Thu Feb 22 00:31:41 2018 From: bill at dartalley.com (Bill O'Neil) Date: Thu, 22 Feb 2018 00:31:41 -0500 Subject: [undertow-dev] Worker thread queue size and timeout behavior In-Reply-To: References: Message-ID: I'm not positive but I believe you need to look into the AcceptingChannel. See the bound AcceptingChannel for HTTP here. https://github.com/undertow-io/undertow/blob/master/core/src/main/java/io/undertow/Undertow.java#L192 Digging a little further you find NioXnioWorker.createTcpConnectionServer https://github.com/xnio/xnio/blob/3.x/nio-impl/src/main/java/org/xnio/nio/NioXnioWorker.java#L177 Notice the backlog option. The Javadoc from ServerSocker.bind * The {@code backlog} argument is the requested maximum number of * pending connections on the socket. Its exact semantics are implementation * specific. In particular, an implementation may impose a maximum length * or may choose to ignore the parameter altogther. The value provided * should be greater than {@code 0}. If it is less than or equal to * {@code 0}, then an implementation specific default will be used. * @param endpoint The IP address and port number to bind to. * @param backlog requested maximum length of the queue of * incoming connections. So depending on the implementation it may or may not queue. Then back to Undertow you can find .set(Options.BACKLOG, 1000) https://github.com/undertow-io/undertow/blob/master/core/src/main/java/io/undertow/Undertow.java#L138 So it defaults to a queue size of 1000 as long as the underlying implementation supports it. You can configure it with the BACKLOG option. Bill On Thu, Feb 22, 2018 at 12:04 AM, Brad Wood wrote: > I'm looking for a bit of understanding on just how Undertow handles large > numbers of requests coming into a server. Specifically when more requests > are being sent in than are being completed. I've been doing some load > testing on a CFML app (Lucee Server) where I happen to have my io-threads > set to 4 and my worker-threads set to 150. I'm using a monitoring tool > (FusionReactor) that shows me the number of currently executing threads at > my app and under heavy load I see exact 150 running HTTP threads in my app > server, which makes sense since I have 150 worker threads. I'm assuming > here that I can't simultaneously process more requests than I have worker > threads (please correct if I'm off there) > > So assuming I'm thinking that through correctly, what happens to > additional requests that are coming into the server at that point? I > assume they are being queued somewhere, but > > - What is this queue? > - How do I monitor it? > - How big can it get? > - Where do I change the size? > - How long do things stay in there before sending back an error to the > HTTP client? > - Can I control what error comes back to the HTTP client in that > scenario? > - If I'm using an HTTP/S and AJP listener, do they all share the same > settings? Do they share the same queues? > > I've done a bit of Googling and reviewed some docs but haven't quite found > any definitive information on this, and a lot of info I found was about > Wildfly specifically so I wasn't sure how much of it applied. > > Thanks! > > ~Brad > > *Developer Advocate* > *Ortus Solutions, Corp * > > E-mail: brad at coldbox.org > ColdBox Platform: http://www.coldbox.org > Blog: http://www.codersrevolution.com > > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180222/00394414/attachment-0001.html From sdouglas at redhat.com Thu Feb 22 05:32:41 2018 From: sdouglas at redhat.com (Stuart Douglas) Date: Thu, 22 Feb 2018 21:32:41 +1100 Subject: [undertow-dev] Worker thread queue size and timeout behavior In-Reply-To: References: Message-ID: On Thu, Feb 22, 2018 at 4:04 PM, Brad Wood wrote: > I'm looking for a bit of understanding on just how Undertow handles large > numbers of requests coming into a server. Specifically when more requests > are being sent in than are being completed. I've been doing some load > testing on a CFML app (Lucee Server) where I happen to have my io-threads > set to 4 and my worker-threads set to 150. I'm using a monitoring tool > (FusionReactor) that shows me the number of currently executing threads at > my app and under heavy load I see exact 150 running HTTP threads in my app > server, which makes sense since I have 150 worker threads. I'm assuming > here that I can't simultaneously process more requests than I have worker > threads (please correct if I'm off there) > > So assuming I'm thinking that through correctly, what happens to > additional requests that are coming into the server at that point? I > assume they are being queued somewhere, but > > - What is this queue? > > The queue is in the XNIO worker (although if you want you could just use a different executor which has its own queue). > > - How do I monitor it? > > XNIO binds an MBean that you can use to inspect the worker queue size. > > - How big can it get? > > It is unbounded, as rejecting tasks from the worker is very problematic in some circumstances. If you want to limit the number of concurrent requests use the io.undertow.server.handlers.RequestLimitingHandler > > - Where do I change the size? > - How long do things stay in there before sending back an error to the > HTTP client? > > If you use the RequestLimitingHandler this is configurable. It has its own queue with a fixed size, and a configurable timeout. > > - Can I control what error comes back to the HTTP client in that > scenario? > > You can using io.undertow.server.handlers.RequestLimit#setFailureHandler > > - If I'm using an HTTP/S and AJP listener, do they all share the same > settings? Do they share the same queues? > > In general yes. You could give each listener its own limiting handler with its own queue if you wanted by explicitly setting the listeners root handler, however in general they will all just use the same handler chain. Stuart > I've done a bit of Googling and reviewed some docs but haven't quite found > any definitive information on this, and a lot of info I found was about > Wildfly specifically so I wasn't sure how much of it applied. > > Thanks! > > ~Brad > > *Developer Advocate* > *Ortus Solutions, Corp * > > E-mail: brad at coldbox.org > ColdBox Platform: http://www.coldbox.org > Blog: http://www.codersrevolution.com > > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180222/c6733e1b/attachment.html From bdw429s at gmail.com Thu Feb 22 10:38:02 2018 From: bdw429s at gmail.com (Brad Wood) Date: Thu, 22 Feb 2018 09:38:02 -0600 Subject: [undertow-dev] Worker thread queue size and timeout behavior In-Reply-To: References: Message-ID: Thanks guys. I seem to have gotten a couple conflicting replies :) > it defaults to a queue size of 1000 > It is unbounded What exactly is the 1000 backlog setting doing? Thanks! ~Brad *Developer Advocate* *Ortus Solutions, Corp * E-mail: brad at coldbox.org ColdBox Platform: http://www.coldbox.org Blog: http://www.codersrevolution.com On Thu, Feb 22, 2018 at 4:32 AM, Stuart Douglas wrote: > > > On Thu, Feb 22, 2018 at 4:04 PM, Brad Wood wrote: > >> I'm looking for a bit of understanding on just how Undertow handles large >> numbers of requests coming into a server. Specifically when more requests >> are being sent in than are being completed. I've been doing some load >> testing on a CFML app (Lucee Server) where I happen to have my io-threads >> set to 4 and my worker-threads set to 150. I'm using a monitoring tool >> (FusionReactor) that shows me the number of currently executing threads at >> my app and under heavy load I see exact 150 running HTTP threads in my app >> server, which makes sense since I have 150 worker threads. I'm assuming >> here that I can't simultaneously process more requests than I have worker >> threads (please correct if I'm off there) >> >> So assuming I'm thinking that through correctly, what happens to >> additional requests that are coming into the server at that point? I >> assume they are being queued somewhere, but >> >> - What is this queue? >> >> The queue is in the XNIO worker (although if you want you could just use > a different executor which has its own queue). > > >> >> - How do I monitor it? >> >> XNIO binds an MBean that you can use to inspect the worker queue size. > > >> >> - How big can it get? >> >> It is unbounded, as rejecting tasks from the worker is very problematic > in some circumstances. If you want to limit the number of concurrent > requests use the io.undertow.server.handlers.RequestLimitingHandler > > >> >> - Where do I change the size? >> - How long do things stay in there before sending back an error to >> the HTTP client? >> >> If you use the RequestLimitingHandler this is configurable. It has its > own queue with a fixed size, and a configurable timeout. > > >> >> - Can I control what error comes back to the HTTP client in that >> scenario? >> >> You can using io.undertow.server.handlers.RequestLimit#setFailureHandler > > >> >> - If I'm using an HTTP/S and AJP listener, do they all share the same >> settings? Do they share the same queues? >> >> In general yes. You could give each listener its own limiting handler > with its own queue if you wanted by explicitly setting the listeners root > handler, however in general they will all just use the same handler chain. > > Stuart > > >> I've done a bit of Googling and reviewed some docs but haven't quite >> found any definitive information on this, and a lot of info I found was >> about Wildfly specifically so I wasn't sure how much of it applied. >> >> Thanks! >> >> ~Brad >> >> *Developer Advocate* >> *Ortus Solutions, Corp * >> >> E-mail: brad at coldbox.org >> ColdBox Platform: http://www.coldbox.org >> Blog: http://www.codersrevolution.com >> >> >> _______________________________________________ >> undertow-dev mailing list >> undertow-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/undertow-dev >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180222/74f399f4/attachment.html From jason.greene at redhat.com Thu Feb 22 10:54:17 2018 From: jason.greene at redhat.com (Jason Greene) Date: Thu, 22 Feb 2018 15:54:17 +0000 Subject: [undertow-dev] Worker thread queue size and timeout behavior In-Reply-To: References: Message-ID: Thats the TCP backlog queue, which is only for connections that are being initially established. Once the connection is accepted (which happens pretty quickly since undertows I/o handling is non-blocking) then the queue entry is removed. Worker size does not affect undertows ability to handle incoming connections. The reason applications set limit is just a safeguard against some types of flood/dos. On Feb 22, 2018, at 9:38 AM, Brad Wood wrote: Thanks guys. I seem to have gotten a couple conflicting replies :) > it defaults to a queue size of 1000 > It is unbounded What exactly is the 1000 backlog setting doing? Thanks! ~Brad *Developer Advocate* *Ortus Solutions, Corp * E-mail: brad at coldbox.org ColdBox Platform: http://www.coldbox.org Blog: http://www.codersrevolution.com On Thu, Feb 22, 2018 at 4:32 AM, Stuart Douglas wrote: > > > On Thu, Feb 22, 2018 at 4:04 PM, Brad Wood wrote: > >> I'm looking for a bit of understanding on just how Undertow handles large >> numbers of requests coming into a server. Specifically when more requests >> are being sent in than are being completed. I've been doing some load >> testing on a CFML app (Lucee Server) where I happen to have my io-threads >> set to 4 and my worker-threads set to 150. I'm using a monitoring tool >> (FusionReactor) that shows me the number of currently executing threads at >> my app and under heavy load I see exact 150 running HTTP threads in my app >> server, which makes sense since I have 150 worker threads. I'm assuming >> here that I can't simultaneously process more requests than I have worker >> threads (please correct if I'm off there) >> >> So assuming I'm thinking that through correctly, what happens to >> additional requests that are coming into the server at that point? I >> assume they are being queued somewhere, but >> >> - What is this queue? >> >> The queue is in the XNIO worker (although if you want you could just use > a different executor which has its own queue). > > >> >> - How do I monitor it? >> >> XNIO binds an MBean that you can use to inspect the worker queue size. > > >> >> - How big can it get? >> >> It is unbounded, as rejecting tasks from the worker is very problematic > in some circumstances. If you want to limit the number of concurrent > requests use the io.undertow.server.handlers.RequestLimitingHandler > > >> >> - Where do I change the size? >> - How long do things stay in there before sending back an error to >> the HTTP client? >> >> If you use the RequestLimitingHandler this is configurable. It has its > own queue with a fixed size, and a configurable timeout. > > >> >> - Can I control what error comes back to the HTTP client in that >> scenario? >> >> You can using io.undertow.server.handlers.RequestLimit#setFailureHandler > > >> >> - If I'm using an HTTP/S and AJP listener, do they all share the same >> settings? Do they share the same queues? >> >> In general yes. You could give each listener its own limiting handler > with its own queue if you wanted by explicitly setting the listeners root > handler, however in general they will all just use the same handler chain. > > Stuart > > >> I've done a bit of Googling and reviewed some docs but haven't quite >> found any definitive information on this, and a lot of info I found was >> about Wildfly specifically so I wasn't sure how much of it applied. >> >> Thanks! >> >> ~Brad >> >> *Developer Advocate* >> *Ortus Solutions, Corp * >> >> E-mail: brad at coldbox.org >> ColdBox Platform: http://www.coldbox.org >> Blog: http://www.codersrevolution.com >> >> >> _______________________________________________ >> undertow-dev mailing list >> undertow-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/undertow-dev >> > > _______________________________________________ undertow-dev mailing list undertow-dev at lists.jboss.org https://lists.jboss.org/mailman/listinfo/undertow-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180222/96034afa/attachment-0001.html From bdw429s at gmail.com Thu Feb 22 11:03:10 2018 From: bdw429s at gmail.com (Brad Wood) Date: Thu, 22 Feb 2018 10:03:10 -0600 Subject: [undertow-dev] Worker thread queue size and timeout behavior In-Reply-To: References: Message-ID: Perfect. Thanks everyone! One final question-- how do I get the MBean to monitor the queued requests? A tutorial link would be fine. Thanks! ~Brad *Developer Advocate* *Ortus Solutions, Corp * E-mail: brad at coldbox.org ColdBox Platform: http://www.coldbox.org Blog: http://www.codersrevolution.com On Thu, Feb 22, 2018 at 9:54 AM, Jason Greene wrote: > Thats the TCP backlog queue, which is only for connections that are being > initially established. Once the connection is accepted (which happens > pretty quickly since undertows I/o handling is non-blocking) then the queue > entry is removed. Worker size does not affect undertows ability to handle > incoming connections. > > The reason applications set limit is just a safeguard against some types > of flood/dos. > > > On Feb 22, 2018, at 9:38 AM, Brad Wood wrote: > > Thanks guys. I seem to have gotten a couple conflicting replies :) > > > it defaults to a queue size of 1000 > > > It is unbounded > > What exactly is the 1000 backlog setting doing? > > > Thanks! > > ~Brad > > *Developer Advocate* > *Ortus Solutions, Corp * > > E-mail: brad at coldbox.org > ColdBox Platform: http://www.coldbox.org > Blog: http://www.codersrevolution.com > > > On Thu, Feb 22, 2018 at 4:32 AM, Stuart Douglas > wrote: > >> >> >> On Thu, Feb 22, 2018 at 4:04 PM, Brad Wood wrote: >> >>> I'm looking for a bit of understanding on just how Undertow handles >>> large numbers of requests coming into a server. Specifically when more >>> requests are being sent in than are being completed. I've been doing some >>> load testing on a CFML app (Lucee Server) where I happen to have my >>> io-threads set to 4 and my worker-threads set to 150. I'm using a >>> monitoring tool (FusionReactor) that shows me the number of currently >>> executing threads at my app and under heavy load I see exact 150 running >>> HTTP threads in my app server, which makes sense since I have 150 worker >>> threads. I'm assuming here that I can't simultaneously process more >>> requests than I have worker threads (please correct if I'm off there) >>> >>> So assuming I'm thinking that through correctly, what happens to >>> additional requests that are coming into the server at that point? I >>> assume they are being queued somewhere, but >>> >>> - What is this queue? >>> >>> The queue is in the XNIO worker (although if you want you could just use >> a different executor which has its own queue). >> >> >>> >>> - How do I monitor it? >>> >>> XNIO binds an MBean that you can use to inspect the worker queue size. >> >> >>> >>> - How big can it get? >>> >>> It is unbounded, as rejecting tasks from the worker is very problematic >> in some circumstances. If you want to limit the number of concurrent >> requests use the io.undertow.server.handlers.RequestLimitingHandler >> >> >>> >>> - Where do I change the size? >>> - How long do things stay in there before sending back an error to >>> the HTTP client? >>> >>> If you use the RequestLimitingHandler this is configurable. It has its >> own queue with a fixed size, and a configurable timeout. >> >> >>> >>> - Can I control what error comes back to the HTTP client in that >>> scenario? >>> >>> You can using io.undertow.server.handlers.RequestLimit#setFailureHandler >> >> >>> >>> - If I'm using an HTTP/S and AJP listener, do they all share the >>> same settings? Do they share the same queues? >>> >>> In general yes. You could give each listener its own limiting handler >> with its own queue if you wanted by explicitly setting the listeners root >> handler, however in general they will all just use the same handler chain. >> >> Stuart >> >> >>> I've done a bit of Googling and reviewed some docs but haven't quite >>> found any definitive information on this, and a lot of info I found was >>> about Wildfly specifically so I wasn't sure how much of it applied. >>> >>> Thanks! >>> >>> ~Brad >>> >>> *Developer Advocate* >>> *Ortus Solutions, Corp * >>> >>> E-mail: brad at coldbox.org >>> ColdBox Platform: http://www.coldbox.org >>> Blog: http://www.codersrevolution.com >>> >>> >>> _______________________________________________ >>> undertow-dev mailing list >>> undertow-dev at lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/undertow-dev >>> >> >> > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180222/d460ddc4/attachment.html From masafumi0920 at gmail.com Thu Feb 22 15:17:34 2018 From: masafumi0920 at gmail.com (Masafumi Miura) Date: Fri, 23 Feb 2018 05:17:34 +0900 Subject: [undertow-dev] Worker thread queue size and timeout behavior In-Reply-To: References: Message-ID: You can use jconsole to check org.xnio MBean. (By the way, if you use WildFly 11, you can also check the same metrics under io subsystem through JBoss CLI.) If you use Undertow with XNIO 3.4.3 or later, you can also obtain XnioWorkerMXBean from XnioWorker through Undertow API. For example: - From io.undertow.server.HttpServerExchange: exchange.getConnection().getWorker().getMXBean() - From io.undertow.Undertow: undertow.getWorker().getMXBean() Then, you can access the following metrics from the MXBean: - getBusyWorkerThreadCount() = current busy worker thread count - getWorkerQueueSize() = current queue size of worker thread pool - getCoreWorkerPoolSize() = core worker thread pool size which you configured - getMaxWorkerPoolSize() = max worker thread pool size which you configured - getIoThreadCount() = io thread pool size which you configured Though the latest undertow pom.xml specifies XNIO 3.3.8.Final as a dependency, I believe it's compatible and it works with newer versions of XNIO. (Actually, WildFly 11 comes with Undertow 1.4.18.Final and XNIO 3.5.4.Final.) Thanks, Masafumi On Fri, Feb 23, 2018 at 1:03 AM, Brad Wood wrote: > Perfect. Thanks everyone! One final question-- how do I get the MBean to > monitor the queued requests? A tutorial link would be fine. > > Thanks! > > ~Brad > > Developer Advocate > Ortus Solutions, Corp > > E-mail: brad at coldbox.org > ColdBox Platform: http://www.coldbox.org > Blog: http://www.codersrevolution.com > > > On Thu, Feb 22, 2018 at 9:54 AM, Jason Greene > wrote: >> >> Thats the TCP backlog queue, which is only for connections that are being >> initially established. Once the connection is accepted (which happens pretty >> quickly since undertows I/o handling is non-blocking) then the queue entry >> is removed. Worker size does not affect undertows ability to handle incoming >> connections. >> >> The reason applications set limit is just a safeguard against some types >> of flood/dos. >> >> >> On Feb 22, 2018, at 9:38 AM, Brad Wood wrote: >> >> Thanks guys. I seem to have gotten a couple conflicting replies :) >> >> > it defaults to a queue size of 1000 >> >> > It is unbounded >> >> What exactly is the 1000 backlog setting doing? >> >> >> Thanks! >> >> ~Brad >> >> Developer Advocate >> Ortus Solutions, Corp >> >> E-mail: brad at coldbox.org >> ColdBox Platform: http://www.coldbox.org >> Blog: http://www.codersrevolution.com >> >> >> On Thu, Feb 22, 2018 at 4:32 AM, Stuart Douglas >> wrote: >>> >>> >>> >>> On Thu, Feb 22, 2018 at 4:04 PM, Brad Wood wrote: >>>> >>>> I'm looking for a bit of understanding on just how Undertow handles >>>> large numbers of requests coming into a server. Specifically when more >>>> requests are being sent in than are being completed. I've been doing some >>>> load testing on a CFML app (Lucee Server) where I happen to have my >>>> io-threads set to 4 and my worker-threads set to 150. I'm using a >>>> monitoring tool (FusionReactor) that shows me the number of currently >>>> executing threads at my app and under heavy load I see exact 150 running >>>> HTTP threads in my app server, which makes sense since I have 150 worker >>>> threads. I'm assuming here that I can't simultaneously process more >>>> requests than I have worker threads (please correct if I'm off there) >>>> >>>> So assuming I'm thinking that through correctly, what happens to >>>> additional requests that are coming into the server at that point? I assume >>>> they are being queued somewhere, but >>>> >>>> What is this queue? >>> >>> The queue is in the XNIO worker (although if you want you could just use >>> a different executor which has its own queue). >>> >>>> >>>> How do I monitor it? >>> >>> XNIO binds an MBean that you can use to inspect the worker queue size. >>> >>>> >>>> How big can it get? >>> >>> It is unbounded, as rejecting tasks from the worker is very problematic >>> in some circumstances. If you want to limit the number of concurrent >>> requests use the io.undertow.server.handlers.RequestLimitingHandler >>> >>>> >>>> Where do I change the size? >>>> How long do things stay in there before sending back an error to the >>>> HTTP client? >>> >>> If you use the RequestLimitingHandler this is configurable. It has its >>> own queue with a fixed size, and a configurable timeout. >>> >>>> >>>> Can I control what error comes back to the HTTP client in that scenario? >>> >>> You can using io.undertow.server.handlers.RequestLimit#setFailureHandler >>> >>>> >>>> If I'm using an HTTP/S and AJP listener, do they all share the same >>>> settings? Do they share the same queues? >>> >>> In general yes. You could give each listener its own limiting handler >>> with its own queue if you wanted by explicitly setting the listeners root >>> handler, however in general they will all just use the same handler chain. >>> >>> Stuart >>> >>>> >>>> I've done a bit of Googling and reviewed some docs but haven't quite >>>> found any definitive information on this, and a lot of info I found was >>>> about Wildfly specifically so I wasn't sure how much of it applied. >>>> >>>> Thanks! >>>> >>>> ~Brad >>>> >>>> Developer Advocate >>>> Ortus Solutions, Corp >>>> >>>> E-mail: brad at coldbox.org >>>> ColdBox Platform: http://www.coldbox.org >>>> Blog: http://www.codersrevolution.com >>>> >>>> >>>> _______________________________________________ >>>> undertow-dev mailing list >>>> undertow-dev at lists.jboss.org >>>> https://lists.jboss.org/mailman/listinfo/undertow-dev >>> >>> >> >> _______________________________________________ >> undertow-dev mailing list >> undertow-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/undertow-dev > > > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180223/2f2f701d/attachment-0001.html From bdw429s at gmail.com Thu Feb 22 15:28:14 2018 From: bdw429s at gmail.com (Brad Wood) Date: Thu, 22 Feb 2018 14:28:14 -0600 Subject: [undertow-dev] Worker thread queue size and timeout behavior In-Reply-To: References: Message-ID: Awesome, thx. I'm not using Undertow in Wildfly, but rather another product called Runwar that we bundle in the CommandBox CLI for running Java wars- primarily CFML engines. I'm actually thinking about bugging a couple of the APM vendors for CF apps to see if they'll tap into this in their serve monitors for apps running on Undertow/CommandBox. Thanks! ~Brad *Developer Advocate* *Ortus Solutions, Corp * E-mail: brad at coldbox.org ColdBox Platform: http://www.coldbox.org Blog: http://www.codersrevolution.com On Thu, Feb 22, 2018 at 2:17 PM, Masafumi Miura wrote: > You can use jconsole to check org.xnio MBean. (By the way, if you use > WildFly 11, you can also check the same metrics under io subsystem through > JBoss CLI.) > > If you use Undertow with XNIO 3.4.3 or later, you can also obtain > XnioWorkerMXBean from XnioWorker through Undertow API. For example: > > - From io.undertow.server.HttpServerExchange: exchange.getConnection(). > getWorker().getMXBean() > - From io.undertow.Undertow: undertow.getWorker().getMXBean() > > Then, you can access the following metrics from the MXBean: > > - getBusyWorkerThreadCount() = current busy worker thread count > - getWorkerQueueSize() = current queue size of worker thread pool > - getCoreWorkerPoolSize() = core worker thread pool size which you > configured > - getMaxWorkerPoolSize() = max worker thread pool size which you > configured > - getIoThreadCount() = io thread pool size which you configured > > Though the latest undertow pom.xml specifies XNIO 3.3.8.Final as a > dependency, I believe it's compatible and it works with newer versions of > XNIO. (Actually, WildFly 11 comes with Undertow 1.4.18.Final and XNIO > 3.5.4.Final.) > > Thanks, > Masafumi > > > On Fri, Feb 23, 2018 at 1:03 AM, Brad Wood wrote: > > Perfect. Thanks everyone! One final question-- how do I get the MBean > to > > monitor the queued requests? A tutorial link would be fine. > > > > Thanks! > > > > ~Brad > > > > Developer Advocate > > Ortus Solutions, Corp > > > > E-mail: brad at coldbox.org > > ColdBox Platform: http://www.coldbox.org > > Blog: http://www.codersrevolution.com > > > > > > On Thu, Feb 22, 2018 at 9:54 AM, Jason Greene > > wrote: > >> > >> Thats the TCP backlog queue, which is only for connections that are > being > >> initially established. Once the connection is accepted (which happens > pretty > >> quickly since undertows I/o handling is non-blocking) then the queue > entry > >> is removed. Worker size does not affect undertows ability to handle > incoming > >> connections. > >> > >> The reason applications set limit is just a safeguard against some types > >> of flood/dos. > >> > >> > >> On Feb 22, 2018, at 9:38 AM, Brad Wood wrote: > >> > >> Thanks guys. I seem to have gotten a couple conflicting replies :) > >> > >> > it defaults to a queue size of 1000 > >> > >> > It is unbounded > >> > >> What exactly is the 1000 backlog setting doing? > >> > >> > >> Thanks! > >> > >> ~Brad > >> > >> Developer Advocate > >> Ortus Solutions, Corp > >> > >> E-mail: brad at coldbox.org > >> ColdBox Platform: http://www.coldbox.org > >> Blog: http://www.codersrevolution.com > >> > >> > >> On Thu, Feb 22, 2018 at 4:32 AM, Stuart Douglas > >> wrote: > >>> > >>> > >>> > >>> On Thu, Feb 22, 2018 at 4:04 PM, Brad Wood wrote: > >>>> > >>>> I'm looking for a bit of understanding on just how Undertow handles > >>>> large numbers of requests coming into a server. Specifically when > more > >>>> requests are being sent in than are being completed. I've been doing > some > >>>> load testing on a CFML app (Lucee Server) where I happen to have my > >>>> io-threads set to 4 and my worker-threads set to 150. I'm using a > >>>> monitoring tool (FusionReactor) that shows me the number of currently > >>>> executing threads at my app and under heavy load I see exact 150 > running > >>>> HTTP threads in my app server, which makes sense since I have 150 > worker > >>>> threads. I'm assuming here that I can't simultaneously process more > >>>> requests than I have worker threads (please correct if I'm off there) > > >>>> > >>>> So assuming I'm thinking that through correctly, what happens to > >>>> additional requests that are coming into the server at that point? I > assume > >>>> they are being queued somewhere, but > >>>> > >>>> What is this queue? > >>> > >>> The queue is in the XNIO worker (although if you want you could just > use > >>> a different executor which has its own queue). > >>> > >>>> > >>>> How do I monitor it? > >>> > >>> XNIO binds an MBean that you can use to inspect the worker queue size. > >>> > >>>> > >>>> How big can it get? > >>> > >>> It is unbounded, as rejecting tasks from the worker is very problematic > >>> in some circumstances. If you want to limit the number of concurrent > >>> requests use the io.undertow.server.handlers.RequestLimitingHandler > >>> > >>>> > >>>> Where do I change the size? > >>>> How long do things stay in there before sending back an error to the > >>>> HTTP client? > >>> > >>> If you use the RequestLimitingHandler this is configurable. It has its > >>> own queue with a fixed size, and a configurable timeout. > >>> > >>>> > >>>> Can I control what error comes back to the HTTP client in that > scenario? > >>> > >>> You can using io.undertow.server.handlers. > RequestLimit#setFailureHandler > >>> > >>>> > >>>> If I'm using an HTTP/S and AJP listener, do they all share the same > >>>> settings? Do they share the same queues? > >>> > >>> In general yes. You could give each listener its own limiting handler > >>> with its own queue if you wanted by explicitly setting the listeners > root > >>> handler, however in general they will all just use the same handler > chain. > >>> > >>> Stuart > >>> > >>>> > >>>> I've done a bit of Googling and reviewed some docs but haven't quite > >>>> found any definitive information on this, and a lot of info I found > was > >>>> about Wildfly specifically so I wasn't sure how much of it applied. > >>>> > >>>> Thanks! > >>>> > >>>> ~Brad > >>>> > >>>> Developer Advocate > >>>> Ortus Solutions, Corp > >>>> > >>>> E-mail: brad at coldbox.org > >>>> ColdBox Platform: http://www.coldbox.org > >>>> Blog: http://www.codersrevolution.com > >>>> > >>>> > >>>> _______________________________________________ > >>>> undertow-dev mailing list > >>>> undertow-dev at lists.jboss.org > >>>> https://lists.jboss.org/mailman/listinfo/undertow-dev > >>> > >>> > >> > >> _______________________________________________ > >> undertow-dev mailing list > >> undertow-dev at lists.jboss.org > >> https://lists.jboss.org/mailman/listinfo/undertow-dev > > > > > > > > _______________________________________________ > > undertow-dev mailing list > > undertow-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/undertow-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20180222/6b85c258/attachment.html