[systemd-devel] systemd and mysql with large memory pages

"Jóhann B. Guðmundsson" johannbg at gmail.com
Sat Sep 17 04:36:42 PDT 2011


On 09/17/2011 10:57 AM, Reindl Harald wrote:
> with sysv/lsb you could include the follwoing script via "source"
> and hughe TLB in mysqld worked like a charme
>
> [root at rh:~]$ cat /etc/my.memory.cnf
> # Large-Memory-Pages
> echo 200>  /proc/sys/vm/nr_hugepages
> echo 27>  /proc/sys/vm/hugetlb_shm_group
> echo 2097152>  /proc/sys/kernel/shmall
> ulimit -l unlimited
> ulimit -n 30000
> _____________
>
> calling this via "ExecStartPre" does not work
> so HOW do this on a systemd-environment if your mysqld
> has a hughe key_buffer size?

File a bug against the mysql since this really is not a systemd problem 
and the unit needs to be fixed to source that file however it comes as a 
bit odd if this is done via script ( I have yet to find a maintainer 
that can explain to me why or what warrants having things like this in a 
script ).

What you do is you edit /etc/sysctl.conf and /etc/security/limits.conf 
and set the desired setting there which is the proper way of doing this 
stuff since you rarely change them.

So for /proc/sys/vm/nr_hugepages,/proc/sys/vm/hugetlb_shm_group, 
/proc/sys/kernel/shmall you add or edit in  /etc/sysctl.conf

vm.nr_hugepages=200
vm.hugetlb_shm_group=27
kernel.shmal=2097152l

For ulimit you edit /etc/security/limits.conf

@mysql soft memlock unlimited
@mysql hard memlock unlimited

And for "ulimit -n 30000"  you can add to the unit file LimitNOFILE=30000

JBG


More information about the systemd-devel mailing list