mysql 5 performance

2009-01-30 Thread lance raymond
Sorry if this seems to be a double post, but not sure if the mysql list send
yourself a copy (as I didn't get the 1st one).  But a little has changed,
not much, but basically I have an old fc5 machine running mysql 4.1 and a
newer server running centos5 / mysql 5.0.45.  The whole site is almost
unusable now (the older server is having hard drive issues and being
replaced), and I think it's just a mysql 5 startup or config change but I am
not sure.  Our test page shows the queries with the query times, and here is
just one admin page;
*mysql4:*
getting all product infodone (12858 unique products, 1 secs).
creating product tablesdone (7 sec).
getting all presold itemsdone (1 sec).
getting order historydone (13 sec).

*mysql 5:*
getting all product infodone (12858 unique products, 0 secs).
creating product tablesdone (273 sec).
getting all presold itemsdone (1 sec).
getting order historydone (15 sec).

I don't know but guessing now, mysql 5 shows the following 2 items running
on a ps list;

 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql
--socket=/var/lib/mysql/mysql.sock --log-error=/var/log/mysqld.log
--pid-file=/var/run/mysqld/mysqld.pid

 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql
--pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking
--socket=/var/lib/mysql/mysql.sock

Questions;
1.Do I need external-locking skipped?
2.Are there tools like mtop for mysql 5 to monitor what's going on?  The box
(even on the 200+ second page loads)  is sitting at 95% idle with no real
load.
3. MySql 4 process list shows an actual tree;
19188 ?S  0:00 /bin/sh /usr/bin/mysqld_safe
--datadir=/var/lib/mysql --pid-file=/var/lib/mysql/classic.pid
19219 ?S  0:03  \_ [mysqld]
19220 ?S  0:05  \_ [mysqld]
19221 ?S  0:00  \_ [mysqld]
19222 ?S  0:00  \_ [mysqld]
19223 ?S  0:00  \_ [mysqld]
19224 ?S  0:00  \_ [mysqld]
19225 ?S  0:00  \_ [mysqld]
19226 ?S  0:06  \_ [mysqld]
19227 ?S  0:00  \_ [mysqld]
19228 ?S  0:02  \_ [mysqld]

I am not sure, but does that mean it's multi-threading allowing multiple
things to be done at once?  If so, is that possible on mysql5.

I may be way off on one or all, but at least some sort of reply is
appreciated.  It's been 3 day's, I see some of the questions being thrown
out and answered so I know it's an active list, so am I assuming no-one has
upgraded from 4 to 5 and seen this?

Anything to help me start fixing this is apprecited.
Lr


mysql 5 new install help requested

2009-01-29 Thread lance raymond
Man, the forums are good, but lists are just so much easier!  Anyway, I left
post unanswered now and I need to get this problem solved, so I am hoping
this list is more direct.

Basically a fc5/mysql4 server is having hard drive errors.  We had a
slightly newer/faster server, so I staged it with centOS5, mysql5.  The
server is expanentially slower, and I am trying to see if there is anything
db wise I can look / tweak.  Basically the mysql 4 server looks to have
numerous threads running see the ps snapshot;

25243 ? S 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql
--pid-file=/var/lib/mysql/classic.pid
25274 ? S 0:25 \_ [mysqld]
25275 ? S 0:37 \_ [mysqld]
25276 ? S 0:00 \_ [mysqld]
25277 ? S 0:00 \_ [mysqld]
25278 ? S 0:00 \_ [mysqld]
25279 ? S 0:00 \_ [mysqld]
25280 ? S 0:00 \_ [mysqld]
25281 ? S 0:03 \_ [mysqld]
25282 ? S 0:00 \_ [mysqld]
25283 ? S 0:15 \_ [mysqld]

The mysql 5 shows the following running;
root 10245 0.0 0.0 4472 1092 pts/0 S 23:13 0:00 /bin/sh /usr/bin/mysqld_safe
--defaults-file=/etc/my.cnf --pid-file=/var/run/mysqld/mysqld.pid
--log-error=/var/log/mysqld.log
mysql 10281 5.8 1.1 141544 24028 pts/0 Sl 23:13 0:19 /usr/libexec/mysqld
--defaults-file=/etc/my.cnf --basedir=/usr --datadir=/var/lib/mysql
--user=mysql --pid-file=/var/run/mysqld/mysqld.pid
*--skip-locking*--socket=/var/lib/mysql/mysql.sock

I first tried to start it by hand with the slow-log options, but never saw a
file.  Then tried in the my.cnf file and still nothing and also noticed the
skip-locking option running where I don't see it in the startup.

So all the above comes down to this question(s).  Should mysql5 with a
generic rpm install run this slow compared to mysql 4.  A query that takes
24 seconds is taking more than 5 minutes and I am wondering if it's a thread
issue, etc. as this is a live webserver with hundreds on in/out connections.

Thanks on getting me started on this one