Skip to main content

Scaling Repositories

Docker repositories are publicly exposed using connector ports. These connector ports are set up within the Nexus Repository and use the connector thread allocation in the underlying Eclipse Jetty. Eclipse Jetty has a default of 400 threads in its pool size that it draws from to allocate threads for new connectors.

When there is a requirement to have many Docker registries it potentially leads to configuring many repositories using many different connector ports.

Our support article Understanding Eclipse Jetty 9.4.8 Thread Allocation provides details on how allocation works and why at a certain amount of repositories with connectors the pool can maxed out. The IllegalStateExceptions warning may be seen indicating that there are insufficient configured threads.

Reverse Proxy

Using a reverse proxy in front of Nexus Repository, you may dynamically map docker requests to Nexus Repository Docker repositories instead of configuring new port connectors for every repository. The reverse proxy does not require port numbers to be specified and therefore no new connectors on your docker repositories are required.

See Docker Repository Reverse Proxy Strategies for more details on these strategies.

Changing the thread pool size

Changing the thread pool size is not a sustainable solution for scaling performance. We suggest being conservative in increasing the maximum threads as each new thread in the pool has the potential to increase workload inside of Nexus Repository for concurrent request threads.

Modify the number of threads in the thread pool by adding the following to the jetty configuration. Nexus Repository must be restarted for the changes to be picked up.

$install-dir/etc/jetty/jetty.xml
<Arg name="threadpool">
    <New id="threadpool" class="org.sonatype.nexus.bootstrap.jetty.InstrumentedQueuedThreadPool">
        <Set name="maxThreads">400</Set>
    </New>
</Arg>