Increased sshd.threads, but unsure of how much to increase container.heapLimit

608 views
Skip to first unread message

Greg Hurrell

unread,
Oct 30, 2011, 7:24:36 PM10/30/11
to Repo and Gerrit Discussion
Hi all,

We've just increased sshd.threads so that our Gerrit install can
support more simultaneous users, as advised by Shawn here:

http://groups.google.com/group/repo-discuss/msg/5dfb8af99a3332f6

On Apr 20 2010, 7:38 am, Shawn Pearce <s...@google.com> wrote:
>
> Modify your gerrit.config and set sshd.threads [1] to a higher
> number.  You may also need to increase the memory available to
> Gerrit (this is set by the container.heapLimit [2] variable),
> as each additional thread needs additional working space.

My question is, where do I look for insight into how big the heapLimit
should be? I'm not really sure what the memory cost per SSH thread is
likely to be.

And I'm not knowledgeable about Java, so I don't know where I would
look to see how close our Gerrit process is to running into the limit,
nor what limit it is operating under (the startup script doesn't pass
in -Xmx unless you have an explicit container.heapLimit, and the java
man page just says that -Xmx has a "default value is chosen at runtime
based on system configuration").

The machine this is running on reports "free -t -m" as follows:

total used free shared buffers
cached
Mem: 2048 1525 522 0 179
606
-/+ buffers/cache: 739 1308
Swap: 4063 0 4063
Total: 6111 1525 4586

And Gerrit's java process is showing as using 1069m virtual, 175m
resident, 10m shared when relatively idle.

Cheers,
Greg

Greg Hurrell

unread,
Oct 30, 2011, 7:37:12 PM10/30/11
to Repo and Gerrit Discussion
Just replying to my own thread, I see that "gerrit show-caches" shows
some useful stats at the bottom:

JGit Buffer Cache:
open files : 5
loaded : 345.77 kb
mem% : 0%

JVM Heap:
max : 643.81 mb
inuse : 62.24 mb
mem% : 82%

That's when idle. After spinning up 8 simultaneous clones:

JVM Heap:
max : 643.81 mb
inuse : 462.35 mb
mem% : 85%

So I believe with that I have enough information to know how to set
the container.heapLimit.

Cheers,
Greg

Matthias Sohn

unread,
Oct 31, 2011, 5:21:13 AM10/31/11
to Greg Hurrell, Repo and Gerrit Discussion
2011/10/31 Greg Hurrell <greg.h...@causes.com>

Hi all,

We've just increased sshd.threads so that our Gerrit install can
support more simultaneous users, as advised by Shawn here:

http://groups.google.com/group/repo-discuss/msg/5dfb8af99a3332f6

On Apr 20 2010, 7:38 am, Shawn Pearce <s...@google.com> wrote:
>
> Modify your gerrit.config and set sshd.threads [1] to a higher
> number.  You may also need to increase the memory available to
> Gerrit (this is set by the container.heapLimit [2] variable),
> as each additional thread needs additional working space.

My question is, where do I look for insight into how big the heapLimit
should be? I'm not really sure what the memory cost per SSH thread is
likely to be.

And I'm not knowledgeable about Java, so I don't know where I would
look to see how close our Gerrit process is to running into the limit,
nor what limit it is operating under (the startup script doesn't pass
in -Xmx unless you have an explicit container.heapLimit, and the java
man page just says that -Xmx has a "default value is chosen at runtime
based on system configuration").

Use a tool like VisualVM [1] to monitor how your JVM is configured and
how much heap is used by the application. In order to enable remote 
monitoring you need to configure the JVM on the server to enable 
JMX communication [2].

When running Gerrit using the embedded Jetty server you can
do this configuration in the etc/gerrit.config file:

[container]
... other java configuration parameters ...
javaOptions = -Dcom.sun.management.jmxremote.port=<port to use for monitoring over JMX>
javaOptions = <more parameters to configure authentication, see [2]>


--
Matthias
Reply all
Reply to author
Forward
0 new messages