April 15th, 2008 — MySQL
Scalability: the ability for a server to grow up (and technically down…but they don’t consider this)
Performs: response time is decent (ie not 30 seconds), easy to measure in production. Make sure there is enough system capacity (system loaded with degrading in response time and failing). With system operations you need to be able to have reasonable times for activities (24 hr backup of 2 terabytes is not acceptable).
Application Growth Parameters
- load - growing from 100 q/sec to 1,000 q/sec
- database size growing from 10 GB to 100 GB
- data distribution - going from 10 friends on average to 250 average
- launching new features - adding full text search can add a heavy load
As applicatons grow all the parameters tend to grow at once. This includeds more complex queries on larger databases. To maintain performance you can optimize the application: schema, queries, caching, sharding and replication.
What is a platform?
Testing done through Micro Benchmarks (simple operations designed to test some particular aspect of behavior). Peter didn’t really explain this enough for me…other than a general idea not sure about it.
Issue with Innodb
- large tables are hard to deal
- backup - physical backup is a must
- can’t move separate tables between servers
- no repair functionality (corruption means dump and restore)
- ALTER TABLE is very slow (MM replication helps)
- table maint with OPTIMIZE TABLE
Online Index Creation in InnoDB
plugin just announced today by Innodb
Innodb can now build indexes without rebuilding whole table (index build done by sort which is much faster). It is ten times faster loading data and adding indexes (separately).
Dealing with Many Tables in Innodb
many people avoid the problem of large table by creating many small tables.
using innodb_file_per_table=1 will resolve this problem.
“Warmup” is still a problem. In 5.0 only one table can be opened at a time. stats update on open makes it quite slow.
Large Buffer Pool Size
In general, the more memory you can get for buffer pool the better it is
Warmup will take a long time. With a 32GB buffer pool, it can take an hour to fill at 600 pages/sec fill rate. SHOW STATUS and SHOW INNODB STATUS gets expensive because of global locking
In addition, shutdown will take longer with large buffer pool.
You can set innodb_max_dirty_pages_pct=0 in advance and it will help with the flushing of the buffer pool.
Peter discussed benchmarking 5.0 and 5.1. It appears that 5.1 has some regression issues! They tested up to 64 threads in a test. In all cases 5.1 simply did not perform as well. Quad-core chips did not perform as well as dual core.
Looks to me like 5.1 has bit to go in respect to Innodb. However, I don’t believe they had the latest patches. He kept mentioning Mark Callhan??
April 15th, 2008 — MySQL
Slides available @ http://www.pythian.com/blogs/917/best-practices-for-database-administrators-slides-and-links
Best Practices
Make it easy for yourself
- automate
- document (everything)
- use your brain for cpu not for storage (request tracking system & google!!!!)
Monitoring Basics
- graph (cacti, nagios)
- alerts (nagios)
- check your checks
Tradeoffs always exists
Backups & Restore
Backup of course but make sure you Restore!!
In case of failure…
- restore from backup
- master/slave
- master/master
- cluster
Test HA (High Availability) also!!
what scenarios do they cover?
what scenarios do they not cover?
Ounces of Prevention
- configuration vs. reality
- possibly memory usage
- disk space/tablespace size (limiting tablespace for innodb?)
Pounds of Cure
- error logs
- slow query logs
- query review (like code review)
mysqldumpslow (what server versions available?)
mysqlsla http://hackmysql.com
mk-query-profiler
show status before and after
mysqlreport http://hackmysql.com
procedure analyse()
what does each column, table do?
what’s in a name? good information!! can you read the data columns/tables and decipher what is going on?
question “best practices”
Schema Profile
- start normal
- denormalize if necessary
- stored procedures for developers (maybe they are afraid of normalization)
Replication
Be careful of TRIGGERs and any DML for SP or UDF
Sync often with mk-table-sync
Handle duplicates carefully
Maintenance
partition
archive
purge
static data
Manage User Expectations
aggregate data once every hour or fifteen minutes
split off processing:
- customer/non-customer
- internal/external
Foreign Keys
application still has to handle problem!!
April 15th, 2008 — MySQL
MySQL 5.1 Features
- table/index partitioning — not parallel, key has to be of a numeric value and no foreign keys
- row-based/hybrid replication — hybrid replication is the default and is changeable on the fly
- disk-based cluster tables
- built-in job scheduler (events) — replacement for cron etc.
- problem SQL identification — dynamic tracing via slow query log and can be logged
- faster full-text search
- archive engine improvements
RC 5.1.24 (Enterprise only I believe) available at conference
GA schedulted for the end of Q2 2008
MySQL 6.0 Features
- Falcon — user defined tablespaces
- maria
- online backups
- optimizer enhancements
scheduled for the end of 2008 (but I am making NO bets on it!! )
It looks like MySQL is beginning to de-couple cluster from the base server project. They have a roadmap of cluster products through the rest of this year and into next year. I think this is a great plan since the cluster product/engine is so different from everything else.
memcached will be offered support under MySQL Enterprise
MySQL 6.X — “citadel” mid to end 2009 is the plan
- foreign keys on all engines
- better prepared statements
- better server-side cursors
- replication improvements (checksums)
- data auditing
- external authentication
- security groups/roles
- transparent data encryption
- online alter table
Rob Young is talking about the enterprise products.
April 15th, 2008 — MySQL, MySQL Magazine, News
A few minutes ago I uploaded the new issue of the MySQL Magazine. I am very excited about this issue as the quality continues to increase! Not only do we have a great group of articles, Sheeri Cabral (our new Community Advocate Award winner) did a fabulous job creating an entire new layout and look for the magazine. It looks absolutely outstanding. I have told her several times how much I appreciate it, but let me once again take the time to say I appreciate the tireless work she did on the layout.
Here is a list of the table of contents:
A Tour of MySQL Certification
Coding Corner
On Efficiently Geo-Referencing IPs with MaxMind GeoIP and MySQL GIS
Introducing Kickfire
Automatic Query Optimization with QOT
As always, the magazine is free for download and is available from http://www.mysqlzine.net and http://www.paragon-cs.com/mag. Enjoy!!
April 15th, 2008 — MySQL
Dr. Bell summarized new features found in the implementation of backup and restore in version 6.0.
SQL Driven — run from the command line
Database level backup
- tables
- views
- stored procedures
- stored functions
- triggers
- events
Enterprise level consistitency — from point in time
non-blocking DML operations on Innodb and Falcon
streaming backup data (only to local server file now..should extend to tape or other servers)
tablespace support for falcon
no data engine backup eg: blackhole, merge (didn’t quite understand why this is useful but he gave some reasons)
synchronization with binary log for point-in-time recovery
defaults to mysql datadir although you can specify a directory in the backup filename
example:
BACKUP DATABASE database_name TO ‘database.bak’;
RESTORE command is destructive
backup log information looks useful but Dr. Bell indicates it will be changing probably.
Future plans:
- coverage for all MySQL storage engines
- use plug-in architecture
- backup to other media/servers
- standalone mysqlbackuptool
- full server, database and enhanced point-in-time recovery
Still a work in progress but looks very promising!! Honestly, the backup parts of 6.0 might be the most important features of the upcoming 6.0 servers. Falcon looks nice and sounds nice, but backups rule the day when the $%#@ hits the fan. I personally am excited to finally see development on this front.
Resources:
http://forge.mysql.com/wiki/OnlineBackup
April 15th, 2008 — Uncategorized
Johnathan made mention that the ZFS Filesystem “might” be moving from the CDDL license to a GPL license. Yeah!!
April 15th, 2008 — MySQL, News
What is in the Sun buyout for the MySQL person?
- Performance and Scaling (indicating that they will be working on running MySQL on higher-end hw)
- Support
- Marketplace (partner “ecosystem” with powerful sales channel)
Design Priorities
Reliability (bugs fixed in 5.1: 997 in 2007 plus 386 in 2008)
5.1 GA release by end of June
Performance
5.1.24rc shows an improvement of 10-15% in throughput versus 5.0
Ease of Use
MySQL Workbench GA today
Awards
Applications of the year
Facebook, Virgin Mobile France and Ebay
Partners of the year
Zmanda, Microsoft, and Computacenter
Community Members of the Year
Code contributer - Baron Schwartz
Quality contributer - Diego Medina
Community Advocate - Sheeri Cabral
Overall, much of the talk is general market talk. There is quite a bit of talk about how a major Sun commitment to scale MySQL on larger servers. This is the one thing that I would really like to Sun/MySQL follow through on. Only time will tell.
April 14th, 2008 — MySQL
The conference kicks off tomorrow morning. Tonight we had the community dinner at a Mexican restaurant which was a great chance to meet with a number of people. I would start listing them but I would forget people. Jonathan Schwartz stopped by and Monty Widenius was there also. It was really cool getting to meet so many people that you have only read about online.
Afterwards many people ended up back at the Hyatt where the conference center is located. I finally rolled off to the room at midnight after talking to so many people that there is no way I can keep everyone straight in my head. Oh well, I will try.
Tomorrow is tutorials and the sessions start Tuesday. I am thinking about blogging from each session about the ongoing session. If you aren’t here you should be!! If you are reading this from home it is not too early to begin planning for next year.
April 12th, 2008 — MySQL, News
I came across this this morning:
http://www.cio.com/article/333613/Sun_Claims_Big_Leap_with_MySQL_Upgrade_Next_Week
This certainly seems to indicate the 5.1 will be released during the Users Conference as GA.
Ironically, Thursday night, while having dinner with Baron, Peter Z and Vadim (no..I wasn’t interviewing for Percona!!) we had a brief discussion about this very topic. I think everyone agreed that we wouldn’t be surprised if it was released next week.
April 11th, 2008 — MySQL
For the summer issue of MySQL Magazine (http://www.mysqlzine.net) I have a writer who has kindly volunteered to conducting a survey of current practices, job responsibilities and salaries. Before the survey is put online it would be very beneficial to get input on questions for the survey.
Sample questions:
* how many servers do you manage
* do you have any mysql certifications
The more input we get from the community at this stage the better the survey will be. Please take the time to put some thought into this and post at least one possible question!