2

Trying to increase the number of threads in embedded jetty running in karaf .Im changing the jetty.xml with the following properties as described in the POST .

<Configure class="org.eclipse.jetty.server.Server">   
  <Call name="addConnector">
    <Arg>
      <New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
        <Set name="minThreads">10</Set>
        <Set name="maxThreads">1000</Set>
      </New>
    </Arg> 
  </Call>
</Configure>

And also having org.ops4j.pax.web.cfg file in karaf ,with below properties :

   org.ops4j.pax.web.config.file=${karaf.home}/jetty.xml

so to refer the external configurations (Jetty). But Im not able to increase/decrease the default thread size of the server . So What am I missing ?

Community
  • 1
  • 1
shashantrika
  • 1,039
  • 1
  • 9
  • 29
  • What version of Jetty? That XML is bad, there's no such method to `.addConnector(ThreadPool)` – Joakim Erdfelt Jul 17 '15 at 23:01
  • @JoakimErdfelt is correct. The accepted answer in http://stackoverflow.com/questions/18534025/change-thread-pool-size-in-jetty-9 is now out of date. sprynter has an updated answer. – pd40 Jul 18 '15 at 12:23
  • @JoakimErdfelt : The above **jetty.xml** is generarted when i do a **features:install jetty** in karaf. – shashantrika Jul 20 '15 at 12:53
  • 1
    @shashantrika file a bug with karaf, that XML is not going to work. – Joakim Erdfelt Jul 20 '15 at 12:59
  • But this won't help in the Pax-Web Context, please open an issue for this at the ops4j jira. So we can take a look at it how to pass those params to the embedded instance. – Achim Nierbeck Jul 24 '15 at 20:05
  • @JoakimErdfelt and why should he file a bug at Karaf? Just because there is no QueuedThreadPool which can be configured through a connector. This is already obviously wrong made on the assumption to change that due to the post: http://stackoverflow.com/questions/18534025/change-thread-pool-size-in-jetty-9 – Achim Nierbeck Jul 24 '15 at 20:10
  • 1
    The following issue takes care of setting those properties: https://ops4j1.jira.com/browse/PAXWEB-868 – Achim Nierbeck Jul 26 '15 at 20:22

1 Answers1

2

With the latest Pax-Web 4.2.0 it's possible to configure those settings via configuration admin. The following three new settings can be used:

org.ops4j.pax.web.server.maxThreads
org.ops4j.pax.web.server.minThreads
org.ops4j.pax.web.server.idleTimeout
Achim Nierbeck
  • 5,265
  • 2
  • 14
  • 22