=========================================================================================
Sybase ASE 15.0.3 and RedHat Hugepage setup
Hardware: HP Proliant DL585 G1
ASE Version: Adaptive Server Enterprise/15.0.3/EBF 17687 ESD#1.1
RedHat Version: Red Hat Enterprise Linux Server release 5.4 (Tikanga)
RedHat Kernel: [2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009
x86_64 x86_64 x86_64 GNU/Linux]
The following steps will setup 25GB of hugepages for use with ASE
HP Server Total Physical Memory: 32GB
ASE Server Total Physical Memory: 25GB (As shown below in ASE cfg
file)
********************************************************************
[Physical Memory]
max memory = 12800000
additional network memory = 8192
shared memory starting address = DEFAULT
allocate max shared memory = 1
dynamic allocation on demand = DEFAULT
lock shared memory = 1
heap memory per user = DEFAULT
engine memory log size = DEFAULT
compression memory size = DEFAULT
*********************************************************************
==============================================================================
Following lines were added in /etc/sysctl.conf
*********************************************************************
# Controls the maximum shared segment size, in bytes -- 32GB
kernel.shmmax = 32212254720
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
# Huge pagesetup example: For 25GB, (25*1024*1024)/2048=12800
vm.nr_hugepages = 12800
# Add the gid to the hugetlb_shm_group to give access to the sybase
users
vm.hugetlb_shm_group = 502
kernel.exec-shield=0
**********************************************************************
Good reference for hugepage info: http://unixfoo.blogspot.com/2007/10/hugepages.html
Good reference for hugepage setup: https://bugzilla.redhat.com/show_bug.cgi?id=426877
=================================================================================
Following lines were added in /etc/security/limits.conf
**********************************************************************
#For sybase user... Setting memlock value of 25GB:
25*1024*1024=26214400
sybase hard memlock 26214400
sybase soft memlock 26214400
# End of file
**********************************************************************
************************
REBOOT MACHINE
************************
=================================================================================
The following is a very good script to monitor the usage of hugepages
while you
are configuring ASE for the use. Save in a .sh file and run it. Make
sure that
the first and second values are either the same or your ASE is
configured to use
not more than the value in second column. If your ASE attempts to
allocate more
than available hugepages, the whole system will freeze and you will
then have to
hard reboot to fix the issue.
Here is the script: First value is total configured hugepage, second
is available
hugepages, third value is the reserved hugepage
**********************************************************************
[root@cpsybtest ~]# cat checkMeminfo.sh
while true; do
for i in $(grep ^Huge /proc/meminfo | head -3 | awk '{print $2}'); do
echo -n "$i "
done
echo ""
sleep 5
done
**********************************************************************
================================================================================
If all goes well, you ASE server log will say something like this:
**********************************************************************
00:00000:00000:2010/03/11 03:34:56.14 kernel Checked out license
ASE_CORE
00:00000:00000:2010/03/11 03:34:56.14 kernel Adaptive Server
Enterprise (Enterprise Edition)
00:00000:00000:2010/03/11 03:34:56.21 kernel Using config area from
primary master device.
00:00000:00000:2010/03/11 03:34:56.25 kernel Locking shared memory
into physical memory.
00:00000:00000:2010/03/11 03:35:14.26 kernel Internal run-time model
set for Linux - Native
00:00000:00000:2010/03/11 03:35:14.27 kernel Using 1024 file
descriptors.
00:00000:00000:2010/03/11 03:35:14.27 kernel Adaptive Server
Enterprise/15.0.3/EBF 17687 ESD#1.1 RELSE/P/x86_64/Enterprise Linux/
ase1503/2681/64-bit/FBO/Thu Aug 20 17:17:06 2009
0
***********************************************************************
================================================================================
if it says something like the following, then you configured something
wrong and
you should check the output of sysctl -a, ulimit -l for sybase and max
memory in
ASE cfg.
***********************************************************************
00:00000:00000:2010/03/11 03:20:19.41 kernel Checked out license
ASE_CORE
00:00000:00000:2010/03/11 03:20:19.41 kernel Adaptive Server
Enterprise (Enterprise Edition)
00:00000:00000:2010/03/11 03:20:19.42 kernel Using config area from
primary master device.
00:00000:00000:2010/03/11 03:20:19.43 kernel Locking shared memory
into physical memory.
00:00000:00000:2010/03/11 03:20:19.43 kernel Could not allocate
memory using Huge Pages. Allocated using regular pages. For better
performance, reboot the server after configuri
ng enough Huge Pages.
************************************************************************
Please use the information here at your own risk.
Good luck! Originally created by Amer Khan -- Sybase Technology
Administrator, Canpar Transport Ltd.
=================================================================