source: npl/commonservers/mysql_conf/root/service/mysql/run @ c5c522c

gcc484ntopperl-5.22
Last change on this file since c5c522c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100755
File size: 902 bytes
Line 
1#!/bin/sh
2if [ -e /etc/my.init ];  then
3    INIT="--init-file=/etc/my.init"
4fi
5
6export TMPDIR=/home/system/tmp
7
8### dynamicly configure bufferpool
9#max size of total mysqld=4Gb on 32 bits systems, but there is other stuff in mysqld that uses memory as well. 2200000k seems the maximum for our config on 32 bit
10MAX_POOL=1800000
11
12#total system mem in KB
13MEM_KB=`cat /proc/meminfo | grep MemTotal | sed 's/[^0-9]//g'`
14
15#manual says: pool size 50% of memory, but we use 25% (zarafa also needs a lot)
16(( MEM_POOL = MEM_KB / 4 ))
17if [ "$MEM_POOL" -ge $MAX_POOL ]; then
18        MEM_POOL=$MAX_POOL
19fi
20
21sed "s/^innodb_buffer_pool_size.*/innodb_buffer_pool_size = "$MEM_POOL"K/g" -i /etc/my.cnf
22
23cd /
24umask 077
25exec mysqld --basedir=/usr --datadir=/home/system/mysql5 --user=mysql --log-error=/home/system/mysql5/mysql.err --pid-file=/home/system/mysql5/mysql.pid --socket=/var/run/mysql/mysql.sock --port=3306 $INIT
26
Note: See TracBrowser for help on using the repository browser.