To increase the Jetty thread pool size for a Nexus Repository running in a container, you need to modify the jetty.xml configuration file inside your Nexus installation. Here’s how you can do it:
- Locate or copy the
jetty.xmlfile- If you are using persistent storage (e.g., with Docker or Kubernetes), copy the default
/opt/sonatype/nexus/etc/jetty/jetty.xmlfrom the container to your persistent storage location, such as/nexus-data/etc/jetty/jetty.xmlor a similar path used by your deployment. - For Helm-based deployments, place your customized
jetty.xmlin persistent storage and ensure Nexus uses it on startup.
- If you are using persistent storage (e.g., with Docker or Kubernetes), copy the default
- Edit the
jetty.xmlfileOpen the file and find the section like this:
<Arg name="threadpool"> <New id="threadpool" class="org.sonatype.nexus.bootstrap.jetty.InstrumentedQueuedThreadPool"> <Set name="maxThreads">400</Set> </New> </Arg>
Change the value of
maxThreadsto your desired number, for example:<Set name="maxThreads">800</Set>
- Ensure Nexus uses your custom
jetty.xml- For containerized deployments, you need to set the
nexus-argsinINSTALL4J_ADD_VM_PARAMSenvironment variable to point to your customjetty.xml. For example:-Dnexus-args=/nexus-data/etc/jetty/jetty.xml,/opt/sonatype/nexus/etc/jetty/jetty-http.xml,/opt/sonatype/nexus/etc/jetty/jetty-requestlog.xmlThis ensures Nexus loads your configuration file on startup.
- For containerized deployments, you need to set the
- Restart the Nexus container
- A restart is required for the changes to take effect. There is no supported way to reload the Jetty configuration without a restart in a containerized environment.