0

I try to setup shared memory for Sybase ASE 12.5 on CentOS. My server has 17G memory, I want to make 14G (=17-1-2)available for sybase. (1G for os, 2G for ramdisk 14 = 17-1-2).

here is the info:

[sybase@myserver ASE-12_5]$ free -g
total used free shared buffers cached
Mem: 17 7 9 0 0 7
-/+ buffers/cache: 0 17
Swap: 3 0 3

There are 2G ramdisk setup.

[sybase@myserver ASE-12_5]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 12G 2.6G 8.8G 23% /
/dev/sda1 251M 19M 220M 8% /boot
none 8.7G 0 8.7G 0% /dev/shm ---what's this? is it related kernel.shmmax?
/dev/sdb1 30G 8.4G 20G 30% /home
tmpfs 2.1G 20M 2.1G 1% /db/tempdb -----this is ramdisk, what 's the difference between this and /dev/shm???

then I modify /ect/sysctl.conf as:

[sybase@myserver ASE-12_5]$ cat /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 1
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
# kernel.shmmax = 10737418240
kernel.shmmax= 14738890752 ------modify this to 13.7G
kernel.shmmni = 4096
kernel.shmall = 2097152

then run:

echo "kernel.shmmax=14738890752" >> /etc/sysctl.conf

then reboot CentOS.

then I try to set sybase max memory to 7196724(2K), but I can's start sybase and got error:

00:00000:00000:2014/04/02 16:50:26.92 kernel os_create_region: shmget(0xf402f74d): No space left on device
00:00000:00000:2014/04/02 16:50:26.92 kernel kbcreate: couldn't create kernel region.
00:00000:00000:2014/04/02 16:50:26.92 kernel kistartup: could not create shared memory

It's only allow me to set max memory as 40000009(2k)=7.6G

Not sure why. So setup shared memory on CentOS, only change kernel.shmmax in /etc/sysctl.conf is not enough? Or need to do more?

Also, I don't under 2 rows in output of df -h:

none 8.7G 0 8.7G 0% /dev/shm ---what's this? is it related kernel.shmmax
tmpfs 2.1G 20M 2.1G 1% /db/tempdb -----this is ramdisk

how to resolve this problem?

KentZhou
  • 101
  • 1
  • 2

1 Answers1

1

Trying to allocate larger segments than permitted by shmmax results in EINVAL (Invalid argument), that's not what you are getting. Trying to allocate more than the committed memory limit results in ENOSPC (No space left on device) which is what you are getting.

As far as I recall the limit defaults to half the physical RAM plus total swap space. You can see your current value with this command grep CommitLimit /proc/meminfo

The size of the tmpfs file systems are controlled by the size mount option as explained in man mount.

The /dev/shm file system is used by the shm_open call. That is unrelated to shmget those are two different APIs originating from Posix and SysV.

kasperd
  • 30,455
  • 17
  • 76
  • 124