August 23, 2008

How to track down the source of Aborted_connects

Posted by Baron Schwartz

Yesterday I helped someone who was seeing a lot of "server has gone away" error messages on his website. While investigating this problem, I noticed several things amiss, which appeared to be related but really weren't. The biggest measurable sign was

CODE:
  1. [percona@server ~]$ mysqladmin ext | grep Abort
  2. | Aborted_clients                | 14835        |
  3. | Aborted_connects               | 15598        |

[read more...]

August 22, 2008

MySQL End Of Life (EOL) Policy

Posted by peter

We've discussed today how we should implement MySQL Version advisory in mk-audit tool. One obvious questions was to look at the end of life - it is often bad idea to run MySQL versions past end of life as even security bugs may not be fixed in these (though do not get paranoid, if you're running MySQL in isolated environment the risk may be low).
So how does EOL schedule looks ?
[read more...]

Multiple column index vs multiple indexes

Posted by peter

After my previous post there were questions raised about Index Merge on Multiple Indexes vs Two Column Index efficiency. I mentioned in most cases when query can use both of the ways using multiple column index would be faster but I also went ahead to do some benchmarks today.
[read more...]

August 21, 2008

How to find wrong indexing with glance view

Posted by peter

Quite common beginners mistake is not to understand how indexing works and so index all columns used in the queries.... separately. So you end up with table which has say 20 indexes but all single column ones. This can be spotted with a glance view. If you have queries with multiple column restrictions in WHERE clause you most likely will need to have multiple column indexes for optimal performance. But wait. Do not go ahead and index all combinations. This would likely be poor choice too :)

Rendundant Array of Inexpensive Servers

Posted by peter

So you need to design highly available MySQL powered system... how do you approach that ?
Too often I see the question is approached by focusing on expensive hardware which in theory should be reliable. And this really can work quite well for small systems. It is my experience - with quality commodity hardware (Dell,HP,IBM etc) you would see box failing once per couple of years of uptime which is enough to maintain level of availability needed by many small systems. In fact they typically would have order of magnitude more availability issues caused by their own software bugs, DOS attacks and other issues.
[read more...]

August 18, 2008

Worse than DDOS

Posted by peter

Today I worked on rather interesting customer problem. Site was subject what was considered DDOS and solution was implemented to protect from it. However in addition to banning the intruders IPs it banned IPs of web services which were very actively used by the application which caused even worse problems by consuming all apache slots which were allocated to the problem. Here are couple of interesting lessons one can learn from it.
[read more...]

The ultimate tool for generating optimal my.cnf files for MySQL

Posted by Baron Schwartz

There are quite a few "tuning primers" and "my.cnf generators" and "sample my.cnf files" online. The ultimate tool for generating an optimal my.cnf is not a tool. It's a human with many years of experience, deep knowledge of MySQL and the full application stack, and familiarity with your application and your data.

I don't know exactly the percentage, but quite a few of the servers I take a look at have been "optimized" with some tuning primer or question-and-answer script that spits out "optimal" parameters for my.cnf.

[read more...]

August 12, 2008

Beware of MyISAM Key Cache mutex contention

Posted by peter

Today I was working with the client loading data to MyISAM tables at very high rate. Hundreds of millions rows are loaded daily into single MySQL instance with bursts up to 100K of records/sec which need to be inserted (in the table with few indexes). It was good not all records had to go to the same table and so in theory using multiple thread to do inserts in multiple tables would not be bound by table locks and would be able to use multiple cores efficiently to get good insert rate... or so it seemed.
[read more...]

August 11, 2008

Wonderfull World of MySQL Storage Engines slides are now published

Posted by peter

I should be faster with publishing slides but things are how they are. The slides from my OSCON2008 talk are now published at Percona Presentation Pages.
Enjoy :)

August 9, 2008

Picking datatype for STATUS fields

Posted by peter

Quite commonly in the applications you would need to use some kind of "status" field - status of order - "new", "confirmed", "in production", "shipped" status of job, message etc. People use variety of ways to handle them often without giving enough thought to the choice which can cause problems later.

Perhaps worst, though quite common thing is to define such field as VARCHAR(255) . Even though the stored value is often short the full specified length can be used for internal processing, such as when creating temporary table or sorting.
[read more...]