You are here:  » my.cnf configuration

Support Forum



my.cnf configuration

Submitted by noodles on Sat, 2007-08-11 10:08 in

Hi David,

At times my site can be quite slow to respond, it's got around 112,000 products in it. I read the thread about my.cnf but I seem to have 2 x sort_buffer, can you provide any guidance?

my.cnf currently looks like this...

[mysqld]
max_connections = 200
key_buffer = 16M
myisam_sort_buffer_size = 64M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 1M
table_cache = 1500
thread_cache_size = 128
wait_timeout = 300
connect_timeout = 10
max_allowed_packet = 16M
max_connect_errors = 10
query_cache_limit = 1M
query_cache_size = 32M
query_cache_type = 1
skip-innodb
safe-show-database
ft_min_word_len=1
old-passwords = 1
[mysqld_safe]
open_files_limit = 8192
[mysqldump]
quick
max_allowed_packet = 16M
[myisamchk]
key_buffer = 150M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M

I'm on a VPS with the following spec..

Power Guaranteed RAM
384 MB

Burst RAM
1536 MB

CPU Rate
Equal Share

Operating System
CentOS 4

Any help is appreciated.

Best regards
David

Submitted by support on Sat, 2007-08-11 10:45

Hi David,

Firstly, don't worry about the settings at the bottom underneath the [myisamchk] heading, as they don't apply to the running server. As you have 384 guaranteed available to you, first thing I would do is increase key_buffer_size to 115M as follows:

key_buffer = 115M

Likewise, sort buffer could probably do with being increased considerably, and given that you have a substantial burst memory available to you, I would adjust both values as follows;

myisam_sort_buffer_size = 80M
sort_buffer_size = 80M

It is likely the the slowdown in response coincides with aggressive crawling behavior from robots. I would therefore make sure that in particular, ia_archiver (the Internet Archive crawler) is excluded from all pages, unless you actually want your site in the archive of course...! To do this, add the following to your robots.txt in the root directory of your server:

User-agent: ia_archiver
Disallow: /

Hope this helps!
Cheers,
David.

Submitted by noodles on Sun, 2007-08-12 09:49

Thanks David

Submitted by Rocket32 on Sat, 2011-02-19 15:22

Hello David, I just changed to a dedicated unmanaged server with 1and1 on a Parallel Plesk Panel 10.
my.cnf file is bare. I'm wondering if I have to add those values in. It looks like this...

[mysqld]
set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

I'm on a dedicated server with the following spec...

Speed
2 Processor Cores, 2.6 GHz

RAM
4 GB DDR2 RAM

Operating System
Linux 64Bit •CentOS 5 with Parallels Plesk Panel 10
Option to upgrade to any of following:
•CentOS 5 with Parallels SB Panel 10
•CentOS 5 with Parallels Plesk Panel 10
•CentOS 5 minimal system
•openSUSE 11.3 minimal system
•Debian 5 (Lenny) minimal system
•ubuntu 10.04 LTS minimal system

Problem is I don't see the robot.txt file in the server's root or home directory. I have started adding a few PT sites to this server and it constantly sends an email about server alarm green to red, red to green, etc. When checking server status, I have a problem in following:

MySQL CPU usage 45.9 % 1.16 (?)

One other thing is I would like to know if I add the robots.txt to root directory or home directory to eliminate the spider page caching or where to find it.

Also does operating system matter? If so upgrading to which other one would be better? I have the Plesk Panel working so far, but I am more familiar with Cpanel which I don't think is offered with the package.

Any help is appreciated.

Thanks,
Roy

Submitted by support on Sun, 2011-02-20 08:52

Hi Roy,

Add these lines just after the [mysqld] line:

key_buffer = 115M
myisam_sort_buffer_size = 80M
sort_buffer_size = 80M

A recommended robots.txt is in the distribution as robots.txt.dist - rename this to robots.txt to get started. In addition to the recommended contents, for a very large site I would recommend excluding ia_archiver from all files - to do this, add the following to the end of robots.txt:

User-agent: ia_archiver
Disallow: /

Hope this helps!

Cheers,
David.
--
PriceTapestry.com