| Showing entries 1 to 30 of 30 |
While Domas may have rather effictively trolled the discussion with his post on howto configure table/user statistics (which gave me a good chuckle I do have to say), it’s at least incorrect for Percona Server as you have to enable the “userstat” server option :)
That being said, once enabled there are no extra configuration variables to think about. This is a huge advantage over configuring PERFORMANCE_SCHEMA - which has a total of THIRTY configuration options (31 if you include the global enable/disable option).
Some of these thirty odd configuration variables are only going to matter if
[Read more...]If you haven’t explored the MySQL Performance Schema yet, this is a good place to start. This is Performance Schema 101, a basic introduction to the MySQL 5.6 performance_schema, which records runtime statistics from the MySQL database. The performance_schema is intended to provide access to useful information about server execution while having minimal impact on server performance. Performance_schema is the name of both the storage engine and the database itself, and it was initially implemented in MySQL 5.5. In MySQL 5.6 the engineers added quite a bit of new instrumentation.
The performance_schema database uses views or temporary tables that actually use little to no persistent disk storage .Memory allocation is all done at server startup, so there is no ongoing memory reallocation or
[Read more...]mysql> show tables; +----------------------------------------------+ | Tables_in_performance_schema | +----------------------------------------------+ | cond_instances | |[Read more...]
I saw a post on profiling memory usage today and this reminds me of several discussions I have had with different people.
Why would you want to profile the memory usage? Usually to see where memory is allocated and for what purposes, and usually you only care when memory usage is higher than expected. That is a DBA normally wants to use all available memory on a server for mysqld, whatever that size may be.
Configuration parameters may be inappropriate and need adjusting, so having a way to determine the range of memory usage based on those parameters would be most helpful. However, the configuration parameters as a whole put no limit on memory used, so different workloads can quite easily lead to memory being
[Read more...]Not much to add really to the bug I’ve filed here: bug#67159.
Again this GTID stuff looks good, but seems to prevent changes in the configuration of performance_schema, which I think is not appropriate, especially as P_S now has lots of extra goodies and after 5.6 will surely have even more.
mysql> select * from file_summary_by_event_name order by count_read desc,count_write desc limit 10;[Read more...]
+--------------------------------------+------------+-------------+--------------------------+---------------------------+
| EVENT_NAME
Monitoring MySQL’s replication has always been a bit hit and miss, especially when trying to detect whether a slave is becoming overloaded or not. There’s been a few ways to do this in the past:
I’ve written before about how you can monitor the last wait per connection with Performance Schema in MySQL 5.5.
That solution joined the performance_schema.events_waits_current with the performance_schema.threads and INFORMATION_SCHEMA.PROCESSLIST tables.
Joining to INFORMATION_SCHEMA.PROCESSLIST is a necessary evil
[Read more...]I love our community.
Not long after posting my update on ps_helper, I had a couple of comments around the formatting of values within the output. Daniël van Eeden gave the suggestion that I could add a couple of Stored Functions, for formatting byte and time based values.
Of course, this was a great idea – not least for myself, because I no longer have to worry about how to format certain columns in the output.
I’ve added the following:
[Read more...]In my last post, I described a specific problem with prepared statements into which PERFORMANCE_SCHEMA can give visibility. That made me wonder whether PERFORMANCE_SCHEMA can also be used to identify other areas where prepared statements run into problems. The most significant problem tends to be leakage of prepared statements. This can inflate memory usage, both on the server and application side, and it’s not uncommon to find applications which fail to close prepared statements.
So the question is, what can PERFORMANCE_SCHEMA tell us about how connections close (or more importantly, fail to close) prepared statements?
At the most basic level, one can check the number of PREPARE statements executed compared to DEALLOCATE PREPARE, and you can do that using global status variables. You’re shooting for general equality between
[Read more...]Prepared statements have been with MySQL since version 4.1, including the protocol plumbing that helps support it. What I didn’t realize – until a recent expedition through a general query log – is that the mysql command-line interface doesn’t implement the protocol commands that support this explicitly. I came to this realization after observing a byproduct of this behavior.
The initial observation that triggered this exploration was noting that PREPARE and EXECUTE statements, when issued from the mysql command-line interface, result in two entries per command in the general query log:
6 Query PREPARE stmt FROM 'SELECT RAND()' 6 Prepare SELECT RAND() 6 Query EXECUTE stmt 6 Execute SELECT RAND()
Contrast this behavior with what is seen when a client sends COM_PREPARE and
[Read more...]A few days ago, Ronald Bradford asked for a mysqldump –ignore-database option.
As a workaround, he proposes:mysqldump --databases `mysql --skip-column-names \
-e "SELECT GROUP_CONCAT(schema_name SEPARATOR ' ') \
FROM information_schema.schemata WHERE schema_name \
NOT IN ('mysql','performance_schema','information_schema');" \
>` >/mysql/backup/rds2.sql
It's a clever solution, but unfortunately it only works if you have a handful of schemas. If your databases happens to have several dozens (or hundreds or thousands) of schemas (which is where you need this option more), then the output will be truncated to the length of group_concat_max_len (by default, 1024.)
There are two
[Read more...]mysql> select variable_name from information_schema.global_status where variable_name like "com\_%" order by variable_name limit 20; +------------------------+ | variable_name | +------------------------+ | COM_ADMIN_COMMANDS | |[Read more...]
I gave two monitoring related talks at OpenWorld, thanks to all that came along!
Both were monitoring related, the first an introduction to MySQL Enterprise Monitor, and the second a look at some of the new instrumentation that is getting developed, primarily within the MySQL 5.6 release.
If you'd like to get a quick overview of how MySQL Enterprise Monitor works, then take a look through the "Getting to Know MySQL Enterprise Monitor" talk. This gives you a high level view of how the different pieces fit together, and then each of the important factors within the user interface:
Getting to Know MySQL Enterprise Monitor
And if you are interested in seeing how the instrumentation and monitoring
[Read more...]I gave two monitoring related talks at OpenWorld, thanks to all that came along!
Both were monitoring related, the first an introduction to MySQL Enterprise Monitor, and the second a look at some of the new instrumentation that is getting developed, primarily within the MySQL 5.6 release.
If you'd like to get a quick overview of how MySQL Enterprise Monitor works, then take a look through the "Getting to Know MySQL Enterprise Monitor" talk. This gives you a high level view of how the different pieces fit together, and then each of the important factors within the user interface:
Getting to Know MySQL Enterprise Monitor
And if you are interested in seeing how the instrumentation and monitoring
[Read more...]Baron pointed to two really good articles recently by Brendan Gregg on Filesystem Latency (part1 / part2), that I too would recommend everybody read.
They rightly point out that trying to correlate IO statistics from tools such as iostat to a databases workload, especially when that database is on a shared resource, is fraught with complications – and further to that, not the full picture anyway, even on a dedicated system. Brendan
[Read more...]In my previous post, I’ve showed how to use Dtrace to find queries creating disk temporary tables (only available for OS with dtrace: solaris, freebsd, etc).
In MySQL 5.6 (which is not released yet, use “labs” version for now) we can use new performance_schema table events_statements_history or events_statements_history_long to find all performance metrics for all queries including created disk/memory tables, use of index, etc. WOW! This is what I have been waiting for a long time!
To illustrate, I have grabbed mysql-5.6.3-labs-performance-schema-linux2.6-x86_64.tar.gz from labs.mysql.com (this feature is only in labs version) and run sysbench readonly test (you need
[Read more...]One of the first thing to do to use the performance schema is to add "performance_schema" in the my.cnf file.
This typically prompts a long list of question from users, as there is a lot to know here.
This article attempts to cover more specifically this area.
It is long, but (I hope) also worth it, so keep reading ;)
Also, since some new performance schema features have been advertised in the mysql labs, this article also covers some never seen before parts of the performance schema.
Really, keep reading ;)
No. It could, but this is not a good choice.
Let's face it, some users do not even read the documentation.
If someone is not even aware that the performance schema feature exists in 5.5 (or 5.6), turning it on
[Read more...]Another new feature of performance_schema within 5.6 is the ability to monitor both table and index IO – this was added in two parts:
If you read my blog on graphing statement wait times – some of the data that WL#4895 exposes is seen within the examples there, they are within the “light coral” coloured blocks, such as the following from the
[Read more...]Q: Is it possible to enable / disable the performance schema at runtime ?
A: Yes.
The performance schema is affected by three distinct set of configuration parameters, that take effect at compile time, server startup, or runtime.
When building from the source code, make sure the cmake flag 'WITH_PERFSCHEMA_STORAGE_ENGINE' is set to 'ON' (it is by default).
For packages built by Oracle, the performance schema is included by default.
Simply add the 'performance_schema' option to your my.cnf configuration file.
The effect of this option seems mis understood, leading people to think that the performance schema can only be enabled or disabled at server startup time, which is not the case.
The role of this startup option,
[Read more...]Following up to my previous blog on graphing statement execution in performance_schema, Sunny Bains on the InnoDB team pointed out that in looking at the INSERT graph, he didn’t think I had atomic operations enabled within my build.
Particularly here (from trunk):
225 /******************************************************************//** 226 Increments lock_word the specified amount and returns new value. 227 @return lock->lock_word after increment */ 228 UNIV_INLINE 229 lint 230 rw_lock_lock_word_incr( 231 /*===================*/ 232 rw_lock_t* lock,[Read more...]
I tried to come up with a number of topics for this post, but none seemed to really convey what I really feel.. And really this blog is about all of them..
If that doesn’t whet your appetite (and trust me, I need to, this post is long, but I feel is worth reading all the way to the end), then let me start out by asking the question:
Wouldn’t you like to be able to trace what a SQL statement did, either in the same or another session, on a production instance, after the fact? Wouldn’t you
[Read more...]| Showing entries 1 to 30 of 30 |