MySQL Forums
Forum List  »  Performance

Poor performance on knoppix 3.8
Posted by: Paul McCormick
Date: August 06, 2005 11:02PM

Hi,
I have 2 servers with knoppix 3.8 installed. Once server is for production and the other is for testing. The production server is a P4 3GHz with hyperthreading and 1 GB ram. The test server is a P4 2.26GHz with 512MB ram.

The problem is that queries run on the production server run much slower than on the test server. Both databases contain the same data.

Both servers are running mysql 4.0.24_Debian-2-log ( Source distribution ). Here is the test that I have done.
1) Turned off query cache on both servers.
2) Allocated plenty of memory to the key buffer.
3) Turned off any applications connected to the db so there would be no updates/inserts happening.
4)Ran an analyze and optomize on the table being queried.
5) Run an explain plan on the query to make sure the same index is being used on both servers.
6) Run the query once on each server to warm up the cache.
7) Run the query again and checked using mysql admin that I was getting 100% hit rate in the key buffer.
)
7) Timed the query on both servers. The test server ( 2.2Ghz ) takes 3 seconds while the production server ( 3 Ghz) takes 20 seconds. Thats a huge difference and I am at a loss to explain it.

I then turned off hyper threading off and reran the tests and got similar results.

Here is some more technical detail about the problem.
The query in mysql-slow.log
# Query_time: 23 Lock_time: 0 Rows_sent: 27196 Rows_examined: 458305
select tdate,open,high,low,close from minute where code = 'USD/JPY' and tdate >= '2005-07-1200:00:00' and tdate <= '2005-08-08 23:59:00' order by tdate desc limit 120000;

Here is the EXPLAIN for the query:
+--------+-------+---------------+---------+---------+------+--------+-------------+
| table | type | possible_keys | key | key_len | ref | rows | Extra |
+--------+-------+---------------+---------+---------+------+--------+-------------+
| minute | range | PRIMARY | PRIMARY | 15 | NULL | 547484 | Using where |
+--------+-------+---------------+---------+---------+------+--------+-------------+


Here is the table description:
desc minute;
+-----------+-----------------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-----------------+------+-----+---------------------+-------+
| tdate | datetime | | PRI | 0000-00-00 00:00:00 | |
| code | char(7) | | PRI | | |
| open | double unsigned | | | 0 | |
| high | double unsigned | | | 0 | |
| low | double unsigned | | | 0 | |
| close | double unsigned | | | 0 | |
| firsttick | datetime | | | 0000-00-00 00:00:00 | |
| lasttick | datetime | | | 0000-00-00 00:00:00 | |
+-----------+-----------------+------+-----+---------------------+-------+

The number of rows in the table;
mysql> select count(*) from minute;
+----------+
| count(*) |
+----------+
| 3302892 |
+----------+
1 row in set (0.00 sec)

Can anybody explain where there is such a difference between the two servers?

Cheers,
Paul

Options: ReplyQuote


Subject
Views
Written By
Posted
Poor performance on knoppix 3.8
1947
August 06, 2005 11:02PM
1362
August 07, 2005 10:53PM


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.