Last week a customer called me and reported that MySQL was 30
times slower than MS SQL server. Oooops. That's a lot. No way to
argue or throw smoke bombs. 30 times slower! It was a standard
installation of MySQL (typical install option) on plain Windows 7
and the same for MS SQL Server 2008. The test run was a batch of
30.000 INSERT commands in an SQL script. Runtime was 1 minute on
MSSQL and 30 minutes on MySQL. Some tests later we found out that
it was only bad on InnoDB. MyISAM was as fast as MSSQL. (I didn't
care which one was a bit faster. I didn't care as long as InnoDB
was 30 times slower) Finally we nailed the problem down to one
parameter in MySQL: innodb_flush_log_at_trx_commit Each INSERT
statement is a single transaction (autocommit mode). MySQL is
configured very faithfully and ensures that each …
In XtraDB we have the table INNODB_BUFFER_POOL_PAGES_INDEX which shows which pages belong to which indexes in which tables. Using thing information and standard TABLES table we can see how well different tables fit in buffer pool.
PLAIN TEXT SQL:
- mysql> SELECT d.*,round(100*cnt*16384/(data_length+index_length),2) fit FROM (SELECT schema_name,table_name,count(*) cnt,sum(dirty),sum(hashed) FROM INNODB_BUFFER_POOL_PAGES_INDEX GROUP BY schema_name,table_name ORDER BY cnt DESC LIMIT 20) d JOIN TABLES ON (TABLES.table_schema=d.schema_name AND TABLES.table_name=d.table_name);
- +-------------+---------------------+---------+------------+-------------+--------+
- | schema_name | table_name | cnt | sum(dirty) | sum(hashed) | fit |
- …
As soon as we get couple FusionIO cards, there is question how to join them in single space for database. FusionIO does not provide any mirroring/stripping solutions and totally relies on OS tools there.
So for Linux we have software RAID and LVM, I tried to followup
on my post
How many fsync / sec FusionIO can handle, and
check what overhead we can expect using additional layers over
FusionIO card.
The card I used is Fusion-io ioDrive Duo 320GB,
physically it is two cards on single board, and visible as two
cards to OS.
By some reason I was not able to setup LVM on cards, so I've finished tests only for software RAID0 and RAID1.
I used XFS filesystem mounted with "-o nobarrier" option, and I've the test I used in previous post on next configurations:
- Single …
In Released and new coming features I did not
mentioned two additional INFORMATION_SCHEMA tables available in
XtraDB:
It is
- INNODB_TABLE_STATS
- INNODB_INDEX_STATS
These table show statistics about InnoDB tables ( taken from InnoDB data dictionary).
INNODB_TABLE_STATS is
- | table_name | table name in InnoDB internal style ('database/table') |
- | rows | estimated number of all rows |
- | clust_size | cluster index (table/primary key) size in number of pages|
- | other_size | other index (non primary key) size in number of pages|
- | modified | internal counter to judge whether statistics recalculation should be done |
INNODB_INDEX_STATS is
- | table_name | table name in …
Using the Embedded InnoDB plugin I’m working on, you can use the INNODB_STATUS table function in the data_dictionary, you can do pretty neat things.
For example, we can see that each autocommit transaction causes an fsync and if you insert multiple rows ina single statement, you still only get 1 fsync:
drizzle> SELECT * FROM DATA_DICTIONARY.INNODB_STATUS
-> WHERE name="fsync_req_done";
+----------------+-------+
| NAME | VALUE |
+----------------+-------+
| fsync_req_done | 25 |
+----------------+-------+
1 row in set (0 sec)
drizzle> insert into t1 values (1);
Query OK, 1 row affected (0.05 sec)
drizzle> SELECT * FROM DATA_DICTIONARY.INNODB_STATUS WHERE name="fsync_req_done";
+----------------+-------+
| NAME | VALUE |
+----------------+-------+
| fsync_req_done | 26 |
+----------------+-------+
1 row in set (0 sec)
drizzle> insert into t1 values (1),(2),(3),(4);Query OK, 4 rows affected (0 …[Read more]
I am rather excited about being able to do awesome things such as this to get the current configuration of your server:
drizzle> SELECT NAME,VALUE
-> FROM DATA_DICTIONARY.INNODB_CONFIGURATION
-> WHERE NAME IN ("data_file_path", "data_home_dir");
+----------------+-------+
| NAME | VALUE |
+----------------+-------+
| data_file_path | NULL |
| data_home_dir | ./ |
+----------------+-------+
2 rows in set (0 sec)
drizzle> SELECT NAME,VALUE
-> FROM DATA_DICTIONARY.INNODB_CONFIGURATION
-> WHERE NAME IN ("data_file_path", "data_home_dir");
+----------------+-------+
| NAME | VALUE |
+----------------+-------+
| data_file_path | NULL |
| data_home_dir | ./ |
+----------------+-------+
2 rows in set (0 sec)
drizzle> SELECT NAME,VALUE
-> FROM DATA_DICTIONARY.INNODB_CONFIGURATION
-> WHERE NAME = "io_capacity";
+-------------+-------+
| NAME | VALUE | …[Read more]
I am very fortunate to be sent to a Percona innodb low level conference - with one of the guys who has written the High Performance MySQL book. One of the key items will be to dive deep into the Innodb kernel and find out what the hell the thing is doing. To that end I'm going post what I know about the 'show innodb status' output - now my aim from this conference is to pick up on some of the areas that I'm green in to identify and resolve more MySQL performance problems.
So here is my 'show innodb status' walkthrough:
mysql> show innodb status\G*************************** 1. row *************************** Type: InnoDB Name:Status:=====================================100308 17:05:14 INNODB MONITOR OUTPUT=====================================Per second averages calculated from the last 14 secondsThe following information is based on stats gathered in the last 14 seconds - Generally a good 30 seconds should pass …
[Read more]I’ve been noticing an undeniable trend in my consulting engagements in the last year or so, and when I vocalized this today, heads nodded all around me. Everyone sees a growth in the number of cases where otherwise well-optimized systems are artificially limited by InnoDB contention problems.
A year ago, I simply wasn’t seeing the need for analysis of GDB backtraces en masse. These days, I’m writing custom tools to gather and analyze backtraces. A year ago, I simply looked at the SEMAPHORE section of SHOW INNODB STATUS. These days I’m writing custom tools to aggregate and reformat that data so I can interpret it more easily. And I’m actually seeing cases of this type of problem multiple times every week. I remember the first time I ran into a server that was literally optimized to the limit, but struggling under the load. It was something new for me, not that long ago. Oh, I’d seen it before, plenty, but was always able to point …
[Read more]I’ve heard about the innodb_plugin but not had time to put it to the test.
Recently though due to some problems I’ve been having with the MySQL Enterprise Monitor (Merlin) I’ve had to try a few changes and had the opportunity to try out the innodb plugin.
I have been using Merlin for some time and like it a lot. It is not perfect but does a good job for me. However, since upgrading to version 2.1 I have been having some database load problems. I long ago split the merlin server into a front- and back-end server with the backend running a standard MySQL 5.1 Advanced package. That has been working fine.
I have been monitoring more and more mysqld servers and recently the database backend could not cope. Basically the writes of …
[Read more]Shortly after I posted my last summary of MySQL releases, our son Mats was born and I went on a 2.5-week vacation. Our developers did not rest in the meanwhile and I'd like to give you a quick update of what's new since then:
- Visual Studio 2010 RC support
- Nested transaction scope support
- Fixed 67 bugs
- Saving your profile/connection passwords in OSX keychain, gnome-keyring or in an encrypted password-vault-file.
- New rapid development features for generating complete SQL …