<div dir="ltr">I am using Wildfly.<div><br></div><div>Thanks,</div><div><br></div><div>Mohammed.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 12, 2015 at 10:55 AM, Stuart Douglas <span dir="ltr"><<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Are you using Wildfly or embedded Undertow?<br>
<br>
If it is the later you can just use io.undertow.servlet.api.DeploymentInfo#setExecutor to use whatever executor implementation you want.<br>
<br>
The reason why most executors don't reduce the number is because there is generally very little point, a parked thread is generally very cheap, while creating new threads is relatively expensive.<br>
<br>
Stuart<br>
<div><div class="h5"><br>
----- Original Message -----<br>
> From: "Mohammed ElGhaouat" <<a href="mailto:melghaouat@gmail.com">melghaouat@gmail.com</a>><br>
> To: "Jason Greene" <<a href="mailto:jason.greene@redhat.com">jason.greene@redhat.com</a>><br>
> Cc: <a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
> Sent: Wednesday, 12 August, 2015 6:19:11 PM<br>
> Subject: Re: [undertow-dev] Resizing undertow thread pool size dynamically<br>
><br>
> We are using the servlet API and I am referring to worker pool. Simply we<br>
> don't want keeping bunch of idle threads in the JVM consuming some resources<br>
> without doing any thing useful.<br>
><br>
> So with the bounded queue executor, when the value of the task-max-threads<br>
> parameter is reached, the number of threads in the worker pool couldn't be<br>
> decreased ?<br>
><br>
> Thank you.<br>
><br>
><br>
> Mohammed.<br>
><br>
> On Tue, Aug 11, 2015 at 9:50 PM, Jason Greene < <a href="mailto:jason.greene@redhat.com">jason.greene@redhat.com</a> ><br>
> wrote:<br>
><br>
><br>
><br>
> > On Aug 11, 2015, at 4:42 AM, Mohammed ElGhaouat < <a href="mailto:melghaouat@gmail.com">melghaouat@gmail.com</a> ><br>
> > wrote:<br>
> ><br>
> ><br>
> > Hi,<br>
> ><br>
> > I would like to know if there is a way to make undertow reducing the size<br>
> > of the thread pool when the server is less loaded. Is there any<br>
> > parameter(or other way) that make an idle thread die after some inactivity<br>
> > time ?<br>
><br>
><br>
> Are you referring to the worker pool or the I/O pool? The I/O pool is special<br>
> and is fixed. The worker pool currently uses a JDK ThreadPoolExecutor with<br>
> an unbounded queue which is a behavior pattern typically desired for web<br>
> servers. That’s not pluggable at the moment, but it could be possible.<br>
><br>
> If you are using the HttpHandler APIs, there is a method on<br>
> HttpServerDispatch that allows you to use your own custom executor for<br>
> blocking tasks (which would allow you to tune the default worker task pool<br>
> very small). If you are using servlet APIs though that uses the standard<br>
> pools we provide.<br>
><br>
> Is there a particular reason you want to kill idle threads? Threads are cheap<br>
> unless you are storing massive amounts of thread local data.<br>
><br>
> --<br>
> Jason T. Greene<br>
> WildFly Lead / JBoss EAP Platform Architect<br>
> JBoss, a division of Red Hat<br>
><br>
><br>
><br>
</div></div>> _______________________________________________<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/mailman/listinfo/undertow-dev</a><br>
</blockquote></div><br></div>