Thử thêm cái coi lào
Feb 9

Tweaking mysql in Kloxo/LxAdmin

Tweaking a web server is very necessary, the less it will consume resource, the more stable it will be and the more website it will be able to handle. Kloxo/lxadmin is a free control panel, and has been working quite great but the problem with it is, it use alot of RAM though kloxo documentation claims that it only eat 33MB ram which is completely wrong in my experience.

There are few ways to tweak kloxo/lxadmin, I already wrote an article on how to replace apache with lighttpd. Lighttpd is much more lighter then apache, though it is bit different but there is an easy way to replace apache with lighttpd in kloxo.

Here I’m going to tell, how to tweak mysql in kloxo.

If you are running simple website or blogs, then you do not need innodb. innodb is a mysql storage system and do not require for simple websites. Therefore disabling innodb in kloxo will safe alot of RAM. Same with bdb, it is storage translator in kloxo.

1. Login to server using ssh
2. open /etc/my.cnf
3. and add lines to disable innodb and bdb
4. save and close file
5. restart mysql, and you will see the huge decrease in RAM.

skip-bdb
skip-innodb

RAM usage before disabling innodb and bdb

[root@srv-187-6 ~]# top
top - 07:16:22 up  2:50,  1 user,  load average: 0.00, 0.00, 0.00
Tasks:  29 total,   2 running,  27 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2097152k total,   269420k used,  1827732k free,        0k buffers
Swap:        0k total,        0k used,        0k free,        0k cached

Disabling innodb and bdb

[root@srv-187-6 etc]# cp my.cnf my.cnf.backup
[root@srv-187-6 etc]# nano my.cnf

Added

skip-bdb
skip-innodb

Restart mysql

[root@srv-187-6 etc]# service mysqld restart
Stopping MySQL:                                            [  OK  ]
Starting MySQL:                                            [  OK  ]

RAM usage after

[root@srv-187-6 etc]# top
top - 07:18:20 up  2:52,  1 user,  load average: 0.06, 0.03, 0.01
Tasks:  29 total,   1 running,  28 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   2097152k total,   163464k used,  1933688k free,        0k buffers
Swap:        0k total,        0k used,        0k free,        0k cached

You can clearly notice that ram usage is decreased from 256MB to 164MB after disabling innodb and bdbd.

Tags: