Does lazytime now obviate the need for PerfDisableSharedMem?

107 views
Skip to first unread message

Ben Evans

unread,
Sep 26, 2019, 10:39:45 AM9/26/19
to mechanica...@googlegroups.com
Hi,

In the course of a tuning exercise to decruft a Cassandra installation
infected with "Tuning By Folklore" hacks, I found this beauty.

The folklore suggests setting the JVM flag -XX:+PerfDisableSharedMem
as per http://www.evanjones.ca/jvm-mmap-pause.html (tl;dr Writing some
hsperfdata memory statistics can block against kernel performing disk
I/O). Setting the flag is intended to reduce large outliers in the GC
tail and other gremlins (because this contention can occur during any
safepoint operation).

All seems reasonable so far.

Reading the comments and doing some other detective work leads to the
possibility that the lazytime Linux mount option may remove the need
to set the option, by removing the contention.

However, there appears to be no direct confirmation of this, and,
rather amusingly, the combination of search terms "lazytime
PerfDisableSharedMem" produces no Google results at all - not
something I thought I'd ever see in the year 2019.

Any thoughts or pointers gratefully received.

Thanks,

Ben

Richard Warburton

unread,
Sep 26, 2019, 11:19:09 AM9/26/19
to mechanica...@googlegroups.com
Hi Ben,
I've not tested but I don't think it would solve the problem. To the best of my knowledge Lazytime just reduces the overhead from tracking filesystem metadata timestamps when doing disk I/O. So I'm sure it would reduce the pausetime from writing hsperf data, but you're still going to get latency from doing the actual write of the hsperfdata contents.

If you want things that connect to a JVM via hsperfdata (like VisualVM) to connect without the pause issues then your best bet is to mount /tmp using tmpfs. Yes, I know it sounds like this should be the default but it isn't on Ubuntu / Debian. Or if you don't want to switch your entire /tmp to tmpfs for memory consumption reasons then you could run your JVM in a container and bind-mount it's /tmp to /dev/shm which will be tmpfs.

regards,

  Richard Warburton

Reply all
Reply to author
Forward
0 new messages