Optimizing MySQL To Let People Argue Jeremy Bingham, OSCON 2011.

Slides:



Advertisements
Similar presentations
TempDB: Performance and Manageability
Advertisements

Scalable Web Site Antipatterns Justin Leitgeb Stack Builders Inc.
From Startup to Enterprise A Story of MySQL Evolution Vidur Apparao, CTO Stephen OSullivan, Manager of Data and Grid Technologies April 2009.
HandlerSocket plugin for MySQL Jun 29, 2010 DeNA Technology Yoyogi IT Platform Dept., System Management Division DeNA Co.,Ltd. Akira Higuchi.
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Case Study: Photo.net March 20, What is photo.net? An online learning community for amateur and professional photographers 90,000 registered users.
MEMORY MANAGEMENT Y. Colette Lemard. MEMORY MANAGEMENT The management of memory is one of the functions of the Operating System MEMORY = MAIN MEMORY =
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Linux and Mysql Tuning Getting the most from your hardware.
Burt King We will cover: Essentials --No command line needed here (mott) What is SQL Server How does it come to life What are the.
REALly, it can be done!!. 1. Review your catalog 2. Enact a plan 3. Ask questions and seek advice 4. Learn how to read course descriptions.
Don’t be bullied, or be a bully.
Symbolic Logic Lesson CS1313 Spring Symbolic Logic Outline 1.Symbolic Logic Outline 2.What is Logic? 3.How Do We Use Logic? 4.Logical Inferences.
Exadata Distinctives Brown Bag New features for tuning Oracle database applications.
© IBM Corporation Informix Chat with the Labs John F. Miller III Unlocking the Mysteries Behind Update Statistics STSM.
2 Proprietary & Confidential What is Sharding Benefits of Sharding Alternatives of Sharding When to start Sharding Agenda.
Drop in replacement of MySQL. Agenda MySQL branch GPL licence Maria storage engine Virtual columns FederatedX storage engine PBXT storage engine XtraDB.
Big Data Working with Terabytes in SQL Server Andrew Novick
SQL Performance 2011/12 Joe Chang, SolidQ
Help! My table is getting too big! How to divide and conquer SQL Relay 2014.
Anatomy of 4GL Disaster CS524 - Software Engineering I Fall I, Sheldon X. Liang, Ph.D. Nathan Scheck CS524 - Software Engineering I Fall I, 2007.
Common Mistakes Developers Make By Bryan Oliver SQL Server Mentor at SolidQ.
Faster Than Alter – Less Downtime Chris Schneider.
Database Optimization & Maintenance Tim Richard ECM Training Conference#dbwestECM Agenda SQL Configuration OnBase DB Planning Backups Integrity.
Blogs – what, why and how? A blog is a web-log It is a simple website that anyone can setup without any advanced computer know-how It’s the future: blogs,
Microsoft Access 2003 Introduction To Microsoft Access 2003.
1 Review #1 l Intro stuff –What is a database, 4 parts, 3 users, etc. l Architecture –Data independence –Three levels, two mappings –Jobs of the DBA.
1 Bag – O – Bytes Organization FPB Helpdesk X /3/04.
MySQL and SSD: Usage Patterns MySQL Conference & Expo Apr-2011 Vadim Tkachenko Co-founder, CTO, Percona Inc Date, time, place: Reporter:
1. When things go wrong: how to find SQL error Sveta Smirnova Principle Technical Support Engineer, Oracle.
Troubleshooting SQL Server Enterprise Geodatabase Performance Issues
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
INFM 603: Information Technology and Organizational Context Jimmy Lin The iSchool University of Maryland Wednesday, March 5, 2014 Session 6: Relational.
PHP meets MySQL.
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
STAR COLLABORATION MEETING July 2004 Michael DePhillips 1 STAR DBs Near And Long Term Plans.
1 Computer and Network Bottlenecks Author: Rodger Burgess 27th October 2008 © Copyright reserved.
Test Loads Andy Wang CIS Computer Systems Performance Analysis.
Block1 Wrapping Your Nugget Around Distributed Processing.
IT253: Computer Organization
Copyright 2002, Jeremy Zawodny MySQL Backup & Recovery O’Reilly Open Source Convention Jeremy Zawodny Yahoo! Finance July 24th, 2002.
Jeremy Bingham, DailyKos.com. Initial Problems Site tipped over way too often Required intensive administration Load times needed to be faster.
1 MONGODB: CH ADMIN CSSE 533 Week 4, Spring, 2015.
Fast Crash Recovery in RAMCloud. Motivation The role of DRAM has been increasing – Facebook used 150TB of DRAM For 200TB of disk storage However, there.
1. When things go wrong: how to find SQL error Sveta Smirnova Principle Technical Support Engineer, Oracle.
ESRI User Conference 2004 ArcSDE. Some Nuggets Setup Performance Distribution Geodatabase History.
My Digital Footprint Gracyn K. WHAT’S A DIGITAL FOOTPRINT? You may not know what a digital footprint is, but you probably already have one yourself. A.
© 2009/2010 Pythian 1 mysqltuner 1.0 Author: Major Hayden Quick sanity check: » Status/system variables » Memory, Architecture, Tables Not all recommendations.
Lecture 10 Page 1 CS 111 Summer 2013 File Systems Control Structures A file is a named collection of information Primary roles of file system: – To store.
IT1001 – Personal Computer Hardware & system Operations Week7- Introduction to backup & restore tools Introduction to user account with access rights.
IT Faculty Software Engineering Seniors UML for a simple DataBase Management System Prepared by: أنس الأسود بشير الفروان زهير الزعبي ياسر المحمد.
So what’s the point? Get it? © Mike’s Math Mall PowerPoint.
Page 1 © Hortonworks Inc – All Rights Reserved Hive: Data Organization for Performance Gopal Vijayaraghavan.
CSCI 156: Lab 11 Paging. Our Simple Architecture Logical memory space for a process consists of 16 pages of 4k bytes each. Your program thinks it has.
Unit-8 Introduction Of MySql. Types of table in PHP MySQL supports various of table types or storage engines to allow you to optimize your database. The.
Let’s get into PostgreSQL performance PGDay India 26 February 2016 Himanchali
Log Shipping, Mirroring, Replication and Clustering Which should I use? That depends on a few questions we must ask the user. We will go over these questions.
How to kill SQL Server Performance Håkan Winther.
Test Loads Andy Wang CIS Computer Systems Performance Analysis.
You Inherited a Database Now What? What you should immediately check and start monitoring for. Tim Radney, Senior DBA for a top 40 US Bank President of.
IT 5433 LM4 Physical Design. Learning Objectives: Describe the physical database design process Explain how attributes transpose from the logical to physical.
Get the Most out of SQL Server Standard Edition
Cleveland SQL Saturday Catch-All or Sometimes Queries
Mailboxes and MySQL at Zimbra
Hitting the SQL Server “Go Faster” Button
Informatica PowerCenter Performance Tuning Tips
Importing and Exporting Data with MySQL
Introduction of Week 3 Assignment Discussion
Upgrading to Microsoft SQL Server 2014
Steve Hood SimpleSQLServer.com
Presentation transcript:

Optimizing MySQL To Let People Argue Jeremy Bingham, OSCON 2011

Working With What You’re Given, or, “The Legacy Tables”

Lots of things that work on a small scale fall apart with millions of pages a day.

Working With What You’re Given, or, “The Legacy Tables” Lots of things that work on a small scale fall apart with millions of pages a day. Just identify the problems!

Working With What You’re Given, or, “The Legacy Tables” Lots of things that work on a small scale fall apart with millions of pages a day. Just identify the problems! Simple, right?

Working With What You’re Given, or, “The Legacy Tables” Lots of things that work on a small scale fall apart with millions of pages a day. Just identify the problems! Simple, right? Improvements possible, but you do have to look back.

Real Tables, Real Problems

Look for bad indexes. –Stories used a 20 byte VARCHAR as a primary key. –Comments used a 20 byte VARCHAR + an integer as a primary key. –Converted both to use integers. –Had to keep the old indexes around, of course.

Real Tables, Real Problems This will sound really dumb…

Real Tables, Real Problems This will sound really dumb… … check the indexes are actually there. For some reason, no one ever bothered to add an index on nicknames on the user table.

The Three Tools I’ve Used Most

EXPLAIN Probably the single most useful tool at your disposal

Slow Query Log If something’s in there a bunch of times, it’s probably a sign.

SHOW PROCESSLIST; And its brother, SHOW FULL PROCESSLIST; Can be deceptive; sometimes what seem to be problem queries are actually fine, but are binding up because of some other query. EXPLAIN helps here.

Upgrade?

Pros of Upgrading New features Get beyond limitations of previous versions –We were held back by a lot of MySQL 3.23isms

Cons of Upgrading

Something can go horribly wrong.

Cons of Upgrading Something can go horribly wrong. Like your data corrupting itself randomly after the upgrade.

Configuration Let us configure our servers in accordance with the MySQL lifestyle.

Configuration tricks we’ve used Turn off XA transactions innodb_flush_log_at_trx_commit = 0 Per table InnoDB files Large Pages Work those buffer pool settings according to your procs and RAM. Actually read the docs, and don’t just go off the ancient sample configs. They leave out a lot of options, or leave in deprecated ones. They’re in Sumerian anyway.

Flog the Hardware

2008 –Master/slave 16GB RAM 8 core with dedicated /tmp, 6x73GB RAID 10, tuned XFS 2010 –Master/slave 32GB RAM, quad core, SSD

Election Season Or, my Christmas comes every two years, but lasts between six and ten months.

Each cycle builds on the last, but is special and unique

Taking Opportunities Redesigning everything and trying to get it right, but still making sure old stuff works.

Using What I’ve Learned Cracking tables apart Judicious partitioning –Where applicable, anyway –You’ll need lots of experimentation and thought with MySQL’s partitioning Ferret out poorly thought out primary keys

Using What I’ve Learned Trim out truly unneeded columns and tables Move less used columns off to the side Better foreign keys and join tables Stat tables, to avoid certain painful queries Lots of testing with a full copy of the data

The Most Important Thing Cache, cache, cache! Cache pages to disk –Great in 2006, blew up horribly during the Iowa caucuses in 2008 Started storing pages in memcached for anonymous users in 2008

More Caching Cache fragments and collections for logged in folks too. Particularly intense queries can be run from a cron so they’re always available. Slower updates can be kicked to a background daemon.

Caching’s Terrible Downside

Never underestimate how much people will gripe if something’s not exactly up to date. Somehow, they’ll notice.

What in God’s name was I thinking?

Jeremy Bingham Photo Credits: – Siegfried, public Domain – PDP-10, Michael L. Umbricht – Stone axe, Didier Descouens – Hammer, Evan-Amos – Adze, Luigi Zanasi – Teamsters strike in 1934, US Government work

Questions?