<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 22, 2018 at 4:04 PM, Brad Wood <span dir="ltr">&lt;<a href="mailto:bdw429s@gmail.com" target="_blank">bdw429s@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I&#39;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&#39;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&#39;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&#39;m assuming here that I can&#39;t simultaneously process more requests than I have worker threads (please correct if I&#39;m off there)  <br></div><div><br></div><div>So assuming I&#39;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</div><div><ul><li>What is this queue?</li></ul></div></div></blockquote>The queue is in the XNIO worker (although if you want you could just use a different executor which has its own queue).<div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><ul><li>How do I monitor it?</li></ul></div></div></blockquote><div>XNIO binds an MBean that you can use to inspect the worker queue size.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><ul><li>How big can it get?</li></ul></div></div></blockquote><div>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</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><ul><li>Where do I change the size?</li><li>How long do things stay in there before sending back an error to the HTTP client?</li></ul></div></div></blockquote><div>If you use the RequestLimitingHandler this is configurable. It has its own queue with a fixed size, and a configurable timeout.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><ul><li>Can I control what error comes back to the HTTP client in that scenario?</li></ul></div></div></blockquote><div>You can using io.undertow.server.handlers.RequestLimit#setFailureHandler</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><ul><li>If I&#39;m using an HTTP/S and AJP listener, do they all share the same settings?  Do they share the same queues?</li></ul></div></div></blockquote><div>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.</div><div><br></div><div>Stuart </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I&#39;ve done a bit of Googling and reviewed some docs but haven&#39;t quite found any definitive information on this, and a lot of info I found was about Wildfly specifically so I wasn&#39;t sure how much of it applied.  </div><br clear="all"><div><div class="gmail-m_-174624443413214439gmail_signature"><div dir="ltr"><div><div dir="ltr"><div></div><div>Thanks!</div><div><br></div><div>~Brad</div><div><br></div><div><b>Developer Advocate</b></div><div><i>Ortus Solutions, Corp </i></div><div><b><br></b></div><div>E-mail: <a href="mailto:brad@coldbox.org" target="_blank">brad@coldbox.org</a></div><div>ColdBox Platform: <a href="http://www.coldbox.org" target="_blank">http://www.coldbox.org</a> </div><div>Blog: <a href="http://www.codersrevolution.com" target="_blank">http://www.codersrevolution.<wbr>com</a></div><div><br></div></div></div></div></div></div>
</div>
<br>______________________________<wbr>_________________<br>
undertow-dev mailing list<br>
<a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/undertow-dev</a><br></blockquote></div><br></div></div>