presented by, mysql ab® & o’reilly media, inc. 0 to 60 in 3.1 tyler carlton cory sessions

21
Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

Upload: abraham-arnold

Post on 12-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

Presented by,

MySQL AB® & O’Reilly Media, Inc.

0 to 60 in 3.1

Tyler Carlton

Cory Sessions

Page 2: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

Presented by,

MySQL AB® & O’Reilly Media, Inc.

<Insert funny joke here>

Page 3: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

The Project Medium sized demographics data mining

project 1,700,000+ User base Hundreds of data points per user

Page 4: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

“Legacy” System – Why Upgrade?

+

Main DB (External Users) Offline backup (Internal Users)

Weekly manual copy backups Max of 3 simultaneous data

pulls 8hr+ data pull times for

complex data pulls Random index corruption

Page 5: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

Notes:Smaller is Better

On average, CPU usage with MySQL was 20% lower than our old database solution.

Page 6: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

Why We Chose MySQL Cluster

Scalable Distributed processing 5 – 9’s Reliability Instant data availability

between internal & external users

Page 7: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

8 Node NDB cluster Dual Core 2 Quad 1.8 ghz 16 Gig ram (Data memory) 6x Raid 10 SAS 15k RPM drives

What We Built – NDB Data Nodes

Page 8: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

What We Built – API & MGMT Nodes

3 API nodes + 1 management node Dual Core 2 Quad 1.8 ghz 8 Gig ram 300 gig 7200rpm (Raid 0)

Page 9: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

NDB Issues with a Large Data Set

NDB load timesLoading from backup: ~ 1 hourRestarting NDB nodes: ~ 1 hour

Note: Load times differ depending on your data size

Page 10: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

NDB Issues with a Large Data Set

Indexing IssuesForce index (NDB picks wrong)Index creation/modification order matters (Seriously!)

Local Checkpoint TuningTimeBetweenLocalCheckpoints - 20 means 4MB (4 × 220) of write operationsNoOfFragmentLogFiles – No. of 4 x 16MB files

None deleted until 3 local checkpointsOn startup: Local checkpoint buffers would overrunRTFM (two, maybe three times)

Page 11: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

NDB Network Issues

Network transport packet sizeBuffer would fill and overrunThis caused nodes to miss their heartbeats and drop

This would happen when: A backup was running A local checkpoint was running at the same time

Solved by : Increasing network packet buffer

Page 12: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

Issues - IN Statements

IN statements die with engine_condition_pushdown=ON with a set of apx. 10,000 or more. (caused with zip codes)

Really need engine_condition_pushdown=ON, but this broke it for us, so… we had to disable it.

Page 13: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

Structuring Apps: Redundency

Redundant power supply + dual power sources Port trunking w/ redundant Gig-E switches # NDB Replicas: 2 (2x4 setup) 64 gig max

data size MySQL (API Nodes ) Heads: Load balanced

with automatic fail over

Page 14: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

Structuring Apps: Internal Apps

Ultimate goal: Offload the data intensive processing to the MySQL nodes

Page 15: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

The Good Stuff: Stats!

Queries per Second (over 20 days) Average 1100-1500 Queries / Sec

during our peak times Average 250 Queries / Sec

Page 16: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

Website Traffic

Stats for March 2008

Page 17: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

Net Usage: NDB Node All NDB data nodes have nearly identical network bandwidth usage

MySQL ( API ) Nodes use about 9 MBs max under our current structure

Totaling 75 MBs during peak(600 Mbs)

Page 18: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

Monitoring & Maintenance SNMP Monitoring: CPU, Network, Memory, Load, Disk

Cron Scripts: Node status & Node down notificationBackupsDatabase maintenance routines

MySQL Clustering book provided the base the scripts

Page 19: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

Dolphin NIC Testing 4 node test cluster 4 x overall performance Brand new patch to handle automatic Ethernet failover / Dolphin Fail Over

( beta as of March 28 )

Net Usage: Next steps…

Page 20: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

Questions?

Page 21: Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions

Contact Information

Tyler Carlton

www.qdial.com

[email protected]

Cory Sessions

CorySessions.com

OrangeSoda.com