1

Running nexus on Amazon Linux on my SC2 instance. Clean install, then I built a small project against it. Not being used by anyone but me.

When I first start Nexus, CPU utilization starts out at 97% and memory usage at 20%. After a few minutes, it'll settle out to like 2-6% CPU and anywhere from 20-40% memory. On a 640MB instance, that means anywhere between 128 and 256MB! Doesn't seem right, especially since Nexus advertises itself as only needing 28MB. What's the deal?

Here's the readout from ps aux, if that helps :

root     25227  0.0  0.1  16980   692 ?        Sl   16:05   0:00 /mnt/vol1/nexus-oss-webapp-1.9.1.1/bin/jsw/linux-x86-64/./wrapper /mnt/vol1/nexus-oss-webapp-1.9.1.1/bin/jsw/linux-x86-64/../conf/wrapper.conf
 wrapper.syslog.ident=nexus wrapper.pidfile=/mnt/vol1/nexus-oss-webapp-1.9.1.1/bin/jsw/linux-x86-64/./nexus.pid wrapper.daemonize=TRUE wrapper.lockfile=/var/lock/subsys/nexus
root     25229  3.0 20.0 1247852 122628 ?      Sl   16:05   0:12 java -Dsun.net.inetaddr.ttl=3600 -Dbasedir=. -Djava.io.tmpdir=./runtime/tmp -Djava.library.path=bin/jsw/linux-x86-64/lib -classpath bin/jsw/li
b/wrapper-3.2.3.jar:./runtime/apps/nexus/lib/plexus-classworlds-2.4.jar:./conf/ -Dwrapper.key=GZhnIo3i5ox4LVLp -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.pid=252
27 -Dwrapper.version=3.2.3 -Dwrapper.native_library=wrapper -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1 org.codehaus.plexus.classworlds.launcher.Launcher

(and yes, I know I shouldn't be running as root. this is only a test)

I should also add that at one point, I asked nexus to index the maven central repository, and when I did this, CPU utilization went skyhigh, between 30% and 90%, and stayed that way until I finally killed the process.

Any thoughts?

2 Answers 2

1

I've seen Nexus using a lot of "%sys" CPU (rather than usr or iowait) on startup (vmstat/top). I haven't got to the bottom of it, but thought this might be a useful pointer.

0

When I first start Nexus, CPU utilization starts out at 97% and memory usage at 20%. After a few minutes, it'll settle out to like 2-6% CPU and anywhere from 20-40% memory. On a 640MB instance, that means anywhere between 128 and 256MB!

I don't see why nexus should only take 28M of heap when you start the instance with 640M; just start the context with the amount of maximum ram you want to give it. In the case you have a great number of repositories, memory usage can drastically increase though. The CPU usage is due to the maintenance of realtime indexes.

I should also add that at one point, I asked nexus to index the maven central repository, and when I did this, CPU utilization went skyhigh, between 30% and 90%, and stayed that way until I finally killed the process.

If you mean the "reindex repository" scheduled task, you don't need it for mirrored repository. Reindexing can be a very heavy task, that is really useful only for locally hosted repositories in which you think there has been maven metadata corruption, or if you modify the nexus filesystem outside of nexus. You only need to "download indexes" and "publish indexes" for mirrored repositories.

This blog post explains the scheduled task in good detail:

http://www.sonatype.com/people/2009/09/nexus-scheduled-tasks/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .