Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

See https://issues.sonatype.org/browse/NEXUS-12041 for additional background.

Adjusting File Handle Limits

Info

Windows operating systems do not need file handle limit adjustments.

Linux

On most Linux systems, persistent limits can be set for a particular user by editing the /etc/security/limits.conf file. To set the maximum number of open files for both soft and hard limits for the nexus user to 65536, add the following line to the /etc/security/limits.conf file, where "nexus" should be replaced with the user ID that is being used to run the repository manager:

Code Block
nexus - nofile 65536

...

Code Block
[Unit]
Description=nexus service
After=network.target

[Service]
Type=forking
LimitNOFILE=65536
ExecStart=/opt/nexus/bin/nexus start
ExecStop=/opt/nexus/bin/nexus stop
User=nexus
Restart=on-abort

[Install]
WantedBy=multi-user.target

Mac OSX

The method to modify the file descriptor limits on OSX has changed a few times over the years. Please note your OS X version and follow the appropriate instructions.

For OS X Yosemite (10.10) and newer

  • Create the file: /Library/LaunchDaemons/limit.maxfiles.plist

    No Format
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
      <plist version="1.0">
        <dict>
          <key>Label</key>
            <string>limit.maxfiles</string>
          <key>ProgramArguments</key>
            <array>
              <string>launchctl</string>
              <string>limit</string>
              <string>maxfiles</string>
              <string>65536</string>
              <string>65536</string>
            </array>
          <key>RunAtLoad</key>
            <true/>
          <key>ServiceIPC</key>
            <false/>
        </dict>
      </plist>

    Note that if this file already exists, then simply ensure the value is at least 65536 as shown.

  • The file must be owned by root:wheel and have permissions -rw-r--r--. These permissions are likely correct by default but you can ensure with the following commands:

    Code Block
    sudo chmod 644 /Library/LaunchDaemons/limit.maxfiles.plist
    sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist
    


  • A reboot is required to enable the change.
  • NXRM must have the JVM option set in $install-dir/bin/nexus.vmoptions

    No Format
    -XX:-MaxFDLimit


For OS X Lion (10.7) up to OS X Mavericks (10.9)

  • Modify /etc/launchd.conf (note this file may not exist by default and would then need to be created) and set

    No Format
    limit maxfiles 65536 65536

    A reboot is required to enable the change.

  • NXRM must have the JVM option set in $install-dir/bin/nexus.vmoptions


    No Format
    -XX:-MaxFDLimit


Java

Nexus Repository Manager 3 is a Java server application that requires specific versions to operate.

...