MySQL Forums
Forum List  »  Performance

Poor MySql Performance
Posted by: Jim Grago
Date: September 21, 2005 01:20PM

I have a question/problem about MySQL Performance. My site uses php 5.0 and Mysql 5.05. My developers have created a session_server and anytime we get over 300 people logged in at one time, the load on my Sql server goes way up. We are about 50 - 50 reads to writes. I have 8 apache servers running fedora core 3 and 1 mysql server. What seems to happen is that a query gets hung from one of my apache servers (dont know why), then mysql starts to backup waiting for this query to execute. Then all other apache servers start doing the same. Then I reach max connections (1024) and my apache servers lose connection to mysql. I end up having to restart mysql to flush the queue and stop and start apache because they get loaded up too. With almost 3,000,000 customers, I cannot afford to have any downtime. I was told that I should use clustering, but in the last webinar I attended for clustering, my database would have to fit in memory. This isnt possible as its over 10gigs. The slq server is also a fedora core 3 server with 4gigs of ram. My question is, can 1 mysql server handle 300+ people being logged into my site at any time? Oh I am also behind a load balancer and average about 100,000 sessions per second to apache. (serve up alot of images).

Here is my my.cnf and as you can see I enabled slow logging and have replication running as well.

[mysqld]
log-bin
server-id=1
binlog-do-db=mydatabasename
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-slow-queries=/var/log/mysql-slow-query.log
skip-innodb
#log=/var/log/mysql.log
set-variable = max_connections=1024
set-variable = wait_timeout=720
set-variable = key_buffer_size=600M
set-variable = table_cache=300
set-variable = read_buffer_size=4M
set-variable = sort_buffer_size=4M
set-variable = join_buffer_size=8M
set-variable = myisam_sort_buffer_size=24M
set-variable = max_allowed_packet=128M
set-variable = query_cache_limit=2M
set-variable = query_cache_size=16M
set-variable = query_cache_type=2
set-variable = ft_min_word_len=3
set-variable = long_query_time=10
[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Any ideas?

Thanks,
Jim

Options: ReplyQuote


Subject
Views
Written By
Posted
Poor MySql Performance
1966
September 21, 2005 01:20PM
1415
September 21, 2005 01:46PM
1384
September 22, 2005 09:25AM
1469
September 22, 2005 01:34PM
1501
September 22, 2005 01:55PM
1417
September 22, 2005 03:39PM
1452
September 23, 2005 07:11AM
1447
September 23, 2005 11:06AM
1502
September 23, 2005 11:25AM
1372
September 23, 2005 12:00PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.