Monday Mar 28, 2011

Configuring your Linux server to use largepages for JRockit


JRockit can use the largepages on Linux platform and it can yield better performance for memory/gc intensive application. However on platform like Solaris and with Hotspot the largepages are already enabled you just have to use them, while on Linux it would require following to get to use the LargePages:
Enable the LargePages in the kernel (using CONFIG_HUGETLB_PAGE and CONFIG_HUGETLBFS).
In most cases we don't have to do the above and we can check if its available for use:

# cat /proc/meminfo | grep Huge
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 2048 kB
This tells us that this system support largepages of 2 MB in size

No we need to tell the kernel how much memory we need to reserve which can be done by:

# echo 4096 > /proc/sys/vm/nr_hugepages
This would reserve 8 GB of memory for largepages.

This change can be made permanent in /etc/sysctl.conf by adding followig line:
vm.nr_hugepages = 4096  

nodev            /mnt/hugepages        hugetlbfs    rw,auto,uid=9500,user,sync    0 0

This line in /etc/fstab will give the user with id 9500 r/w permission on /mnt/hugepages.
This can be activated without reboot:
# mount -a
Its all setup now and JRockit can be started with -XlargePages:exitOnFailure=true , after using this
flag if the vm start successfully then again doing
# cat /proc/meminfo | grep Huge
will tell you how many pages are taken away by your JRockit. If the VM doesn't start that would mean you might have missed some steps.

About

dkumar

Search

Archives
« March 2011
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
29
30
31
  
       
Today