Hyatt Regency San Francisco Airport Burlingame, CA San Francisco, CA October 18-21, 2005 Hardware Layouts for LAMP Installations John Allspaw, Flickr Plumbr.

Slides:



Advertisements
Similar presentations
Capacity Planning for LAMP Architectures John Allspaw Manager, Operations Flickr.com Web Builder 2.0 Las Vegas.
Advertisements

Case Study: Photo.net March 20, What is photo.net? An online learning community for amateur and professional photographers 90,000 registered users.
Database Tuning. Objectives Describe the roles associated with database tuning. Describe the dependency between tuning in different development phases.
Categories of I/O Devices
What to Check SQL Server Buffer Manager: Page Life Expectancy > 300 (seconds) What You’ll See Slow performance across the board Long search crawl.
Cacti Workshop Tony Roman Agenda What is Cacti? The Origins of Cacti Large Installation Considerations Automation The Current.
Building Wikipedia Scalable LAMP on a shoestring budget Brion VibberGatorJUG
CS 300 – Lecture 22 Intro to Computer Architecture / Assembly Language Virtual Memory.
Analysis and Performance Information Systems 337 Prof. Harry Plantinga.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 2: Managing Hardware Devices.
DotSlash: Providing Dynamic Scalability to Web Applications Weibin Zhao and Henning Schulzrinne Department of Computer Science, Columbia University More.
Operating Systems COMP 4850/CISG 5550 Disks, Part II Dr. James Money.
Microsoft Load Balancing and Clustering. Outline Introduction Load balancing Clustering.
OpenFlow Switch Limitations. Background: Current Applications Traffic Engineering application (performance) – Fine grained rules and short time scales.
NovaBACKUP 10 xSP Technical Training By: Nathan Fouarge
RAID Redundancy is the factor for development of RAID in server environments. This allows for backup of the data in the storage in the event of failure.
File Systems and N/W attached storage (NAS) | VTU NOTES | QUESTION PAPERS | NEWS | VTU RESULTS | FORUM | BOOKSPAR ANDROID APP.
1 © Copyright 2008 EMC Corporation. All rights reserved. Symmetrix Capacity Planning and Performance Aspects Bob Rau Technical Business Consultant Symmetrix.
Storage Area Networks The Basics. Storage Area Networks SANS are designed to give you: More disk space Multiple server access to a single disk pool Better.
Distributed Data Stores – Facebook Presented by Ben Gooding University of Arkansas – April 21, 2015.
Sponsored by: PASS Summit 2010 Preview Storage for the DBA Denny Cherry MVP, MCSA, MCDBA, MCTS, MCITP.
Additional SugarCRM details for complete, functional, and portable deployment.
Scalability By Alex Huang. Current Status 10k resources managed per management server node Scales out horizontally (must disable stats collector) Real.
RAMCloud Design Review Recovery Ryan Stutsman April 1,
Day 10 Hardware Fault Tolerance RAID. High availability All servers should be on UPSs –2 Types Smart UPS –Serial cable connects from UPS to computer.
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
Networked File System CS Introduction to Operating Systems.
Module 12: Designing High Availability in Windows Server ® 2008.
Review of Memory Management, Virtual Memory CS448.
Practical Web Management Christopher Gutteridge IWMW 2009.
Best Western Green Bay CHEMS 2013 SYSTEM ARCHITECTURE.
Installing and Configuring IIS. Reliable IIS 6.0 uses a new request-processing architecture and application-isolation environment that enables individual.
Computing and the Web Operating Systems. Overview n What is an Operating System n Booting the Computer n User Interfaces n Files and File Management n.
Copyrighted material John Tullis 10/6/2015 page 1 Performance: WebSphere Commerce John Tullis DePaul Instructor
Hadoop Hardware Infrastructure considerations ©2013 OpalSoft Big Data.
Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions.
STAR COLLABORATION MEETING July 2004 Michael DePhillips 1 STAR DBs Near And Long Term Plans.
Bellwether: Surrogate Services for Popular Content Duane Wessels & Ted Hardie NANOG 19 June 12, 2000.
Guide to Linux Installation and Administration, 2e1 Chapter 2 Planning Your System.
1 Computer and Network Bottlenecks Author: Rodger Burgess 27th October 2008 © Copyright reserved.
Copyright 2006 MySQL AB The World’s Most Popular Open Source Database MySQL Cluster: An introduction Geert Vanderkelen MySQL AB.
IT253: Computer Organization
High-Availability MySQL DB based on DRBD-Heartbeat Ming Yue September 27, 2007 September 27, 2007.
Copyright 2002, Jeremy Zawodny MySQL Backup & Recovery O’Reilly Open Source Convention Jeremy Zawodny Yahoo! Finance July 24th, 2002.
DONE-08 Sizing and Performance Tuning N-Tier Applications Mike Furgal Performance Manager Progress Software
ESRI User Conference 2004 ArcSDE. Some Nuggets Setup Performance Distribution Geodatabase History.
ITGS Network Architecture. ITGS Network architecture –The way computers are logically organized on a network, and the role each takes. Client/server network.
Instructor: Craig Duckett Lecture 07: Tuesday, October 20 th, 2015 Conflicts and Isolation, MySQL Workbench 1 BIT275: Database Design (Fall 2015)
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
BNL dCache Status and Plan CHEP07: September 2-7, 2007 Zhenping (Jane) Liu for the BNL RACF Storage Group.
Web Cache. What is Cache? Cache is the storing of data temporarily to improve performance. Cache exist in a variety of areas such as your CPU, Hard Disk.
High-Availability MySQL with DR:BD and Heartbeat: MTV Japan mobile services ©2008 MTV Networks Japan K.K.
Difference between External and Internal Server Monitoring.
Cofax Scalability Document Version Scaling Cofax in General The scalability of Cofax is directly related to the system software, hardware and network.
Monitoring Dynamic IOC Installations Using the alive Record Dohn Arms Beamline Controls & Data Acquisition Group Advanced Photon Source.
Top 10 Non-SharePoint Technical Issues That Can Doom Your Implementation Robert Bogue (317)
A Complete Guide to Select the Best VPS Hosting Providers.
Andrew Lahiff HEP SYSMAN June 2016 Hiding infrastructure problems from users: load balancers at the RAL Tier-1 1.
Hitting the SQL Server “Go Faster” Button Rob Douglas #509 | Brisbane 2016.
Presented by Michael Rainey South Mississippi Linux Users Group
Load-Balanced Enterprise Web Applications With PHP
Storage Area Networks The Basics.
Integrating Disk into Backup for Faster Restores
Hitting the SQL Server “Go Faster” Button
Optimizing SQL Server Performance in a Virtual Environment
Hitting the SQL Server “Go Faster” Button
Scaling and Performance
INFO 344 Web Tools And Development
Capacity Planning for LAMP Architectures
Client/Server Computing and Web Technologies
Presentation transcript:

Hyatt Regency San Francisco Airport Burlingame, CA San Francisco, CA October 18-21, 2005 Hardware Layouts for LAMP Installations John Allspaw, Flickr Plumbr Flickr (Yahoo) October 18, 2005

Oct. 18, 2005# 2 Hardware Layouts for LAMP Installations Hardware requirements for LAMP installs have to do with: o A decent amount about the actual hardware (“in-box” stuff) o A bit more about the hardware architecture o Which should complement the application architecture

Oct. 18, 2005# 3 Hardware Layouts for LAMP Installations What we’ll talk about here: o Database (MySQL) layouts and considerations o Some miscellaneous/esoteric stuff (lessons learned) o Caching content and considerations

Oct. 18, 2005# 4 Hardware Layouts for LAMP Installations Growing Up, “One Box” solution  Basic web application (discussion board, etc.)  Low traffic  Apache/PHP/MySQL on one machine  Bottlenecks will start showing up: Most likely database before apache/php Disk I/O (Innodb) or locking wait states (MyISAM) Context switching between memory work (apache) and CPU work (MySQL)

Oct. 18, 2005# 5 Hardware Layouts for LAMP Installations ONE BOX

Oct. 18, 2005# 6 Hardware Layouts for LAMP Installations Growing Up, “Two Box” solution  Higher traffic application (more demand)  Apache/PHP on box A, MySQL on box B  Same network = bad (*or is it ?), separate network = good  Bottlenecks with start to be: Disk I/O on MySQL machine (Innodb) Locking on MyISAM tables Network I/O

Oct. 18, 2005# 7 Hardware Layouts for LAMP Installations TWO BOX

Oct. 18, 2005# 8 Hardware Layouts for LAMP Installations Growing Up, “Many Boxes with Replication” solution Yet even higher traffic Writes are separated from reads (master gets IN/UP/DEL, slaves get SELECTs) Diminishes network bottlenecks, disk I/O, and other “in-box” issues SELECTs, IN/UP/DEL can be specified within the application, OR…. Load-balancing can be used

Oct. 18, 2005# 9 Hardware Layouts for LAMP Installations MANY BOX

Oct. 18, 2005# 10 Hardware Layouts for LAMP Installations Slave Lag When slaves can’t keep up with replication They’re too busy: Reading (production traffic) Writing (replication) Manifests as: Comments/photos/any user-entered data doesn’t show up on the site right away So users will repeat the action, thinking that it didn’t “take” the first time, makes situation worse

Oct. 18, 2005# 11 Hardware Layouts for LAMP Installations Insert funny photo here about slave lag* *slave lag isn ’ t funny

Oct. 18, 2005# 12 Hardware Layouts for LAMP Installations Hardware Load Balancing MySQL

Oct. 18, 2005# 13 Hardware Layouts for LAMP Installations How It’s Usually Done Standard MySQL master/slave replication All writes (inserts/updates/deletes) from application go to Master All reads (selects) from application go to a load- balanced VIP (virtual IP) spreading out load across all slaves

Oct. 18, 2005# 14 Hardware Layouts for LAMP Installations

Oct. 18, 2005# 15 Hardware Layouts for LAMP Installations What Is Good About Load Balancing you can add/remove slaves without affecting application, since queries are atomic (sorta/kinda) additional monitoring point and some automatic failure handling you can treat all of your slave pool as one resource, and makes capacity planning a lot easier if you know the ceiling of each slave

Oct. 18, 2005# 16 Hardware Layouts for LAMP Installations How do you know the ceiling (maximum QPS capacity) of each slave ? First make a guess based on benchmarking (or look up some bench results from Tom’s Hardware or anandtech.com, etc. Then get more machines than that :) Scary: in production during a lull in traffic, remove machines from the pool until you detect lag The QPS you saw right before slave lag set in: THAT is your ceiling

Oct. 18, 2005# 17 Hardware Layouts for LAMP Installations

Oct. 18, 2005# 18 Hardware Layouts for LAMP Installations What Can Be Bad/Tough About Load Balancing: not all load-balancers are created equal, not all load- balancing companies expect this product use, so support may still be thin not that many people are doing it in high-volume situations yet, so support from community isn’t large either Gotchas: port exhaustion, health checks, and balance algorithms

Oct. 18, 2005# 19 Hardware Layouts for LAMP Installations Port Exhaustion PROBLEM: LB is basically a traffic cop, nothing more Side effect of having a lot of connections: only ~64,511 ports per each IP (VIP) to use 64,511 ports/120 sec per port…. ~535 max concurrent connections per IP* * Not really, but close to it: tcp_tw_recycle and tcp_tw_reuse

Oct. 18, 2005# 20 Hardware Layouts for LAMP Installations

Oct. 18, 2005# 21 Hardware Layouts for LAMP Installations Port Exhaustion (cont’d) SOLUTION: Use a pool of IPs on the database slave/farm side (Netscaler calls these “subnet IPs”, Alteon calls them “PiPs”) Monitor port/connection usage, know when it’s time to add more

Oct. 18, 2005# 22 Hardware Layouts for LAMP Installations Health checks LB won’t know anything about how well each MySQL slave is doing, and will pass traffic as long as port 3306 is answering Load balancers don’t talk SQL, only things like plain old TCP, HTTP/S, maybe FTP

Oct. 18, 2005# 23 Hardware Layouts for LAMP Installations Health checks (cont’d) Two options: 1.Dirty, but workable:  Have each server monitor itself, and shut off/firewall its own port 3306, even if MySQL is still running

Oct. 18, 2005# 24 Hardware Layouts for LAMP Installations Health checks (cont’d) 2. Cleaner, but a bit more work: Have each server monitor itself, and run a check via xinetd (for example, a nagios monitor)  So the LB can tickle that port, and expect back an “OK” string. If not, it’ll automatically take that server out of the pool  Good for detecting and counteracting isolated incidents of ‘slave lag’ and automatically handling it

Oct. 18, 2005# 25 Hardware Layouts for LAMP Installations Health Checks

Oct. 18, 2005# 26 Hardware Layouts for LAMP Installations Balancing Algorithms Load balancers know HTTP, FTP, basic TCP, but not SQL Two things to care about: Should the server still be in the pool ? (health checks) How should load get balanced ?  “least connections” or “least bandwidth” or “least anything” = BAD  Because not all SQL queries are created equal  Use “round-robin” or “random”  What happens if you don’t: Evil Favoritism™

Oct. 18, 2005# 27 Hardware Layouts for LAMP Installations Evil Favoritism

Oct. 18, 2005# 28 Hardware Layouts for LAMP Installations

Oct. 18, 2005# 29 Hardware Layouts for LAMP Installations Meanwhile….for “in-the-box considerations”  Interleaving memory *does* make a difference  Always RAID10 (or RAID0 if you’re crazy*) but NEVER RAID5 (for Innodb, anyway)  RAID10 has much more read capacity, and a write penalty, but not as much as RAID5  Always have battery backup for HW RAID write caching  Or, don’t use write caching at all

Oct. 18, 2005# 30 Hardware Layouts for LAMP Installations “IN-THE-BOX” considerations (cont’d)  Always have proper monitoring (nagios, etc.) for failed/rebuilding drives  SATA or SCSI ? SCSI ! It’s worth it!  10k or 15k RPM SCSI ? 15k! It’s worth it! (~20% performance increase when you’re disk bound)  For 64bit Linux (AMD64 or EM64T): Crank up the RAM for Innodb’s buffer pool Swapping = very very bad either: Turn it off (slightly scary) Leave it on and set /proc/sys/vm/swapiness = 0

Oct. 18, 2005# 31 Hardware Layouts for LAMP Installations 10k versus 15k drives ? Does it really matter that much ? Some in-the-wild proof….

Oct. 18, 2005# 32 Hardware Layouts for LAMP Installations 10K drives 15K drives Slave Lag in production

Oct. 18, 2005# 33 Hardware Layouts for LAMP Installations Using MySQL with a SAN (Storage Area Network) Do layout storage same as if they would be local Do make sure that the HBA (fiber card) driver is well supported by Linux Don’t share volumes across databases Don’t forget to correctly tune Queue Depth Size, which should be increasing, from server HBA -> switch -> storage

Oct. 18, 2005# 34 Hardware Layouts for LAMP Installations Caching your static content

Oct. 18, 2005# 35 Hardware Layouts for LAMP Installations Caching Static Content  SQUID = good  Relieve your front-end PHP machines from looking up data that will never (or rarely) change  Generate static pages, and cache them in squid, along with your images

Oct. 18, 2005# 36 Hardware Layouts for LAMP Installations Caching Static Content (cont’d)  Use SQUID to accelerate plain-old origin webservers, also known as “reverse-proxy” HTTP acceleration  Described here and elsewhere: 

Oct. 18, 2005# 37 Hardware Layouts for LAMP Installations Basic SQUID layout squid accepts requests on 80 passes on cache misses to apache on 81 apache uses as its docroot an NFS mounted dir should be on local subnet, or dedicated net

Oct. 18, 2005# 38 Hardware Layouts for LAMP Installations Good HW layout for high-volume SQUIDing  Do use SCSI, and many spindles for disk cache dirs  Don’t use RAID  Do use network attached storage, or place the origin servers on separate machines  Do use ext3 with noatime for disk cache dirs  Do monitor squid stats

Oct. 18, 2005# 39 Hardware Layouts for LAMP Installations Flickr: How We Roll

Oct. 18, 2005# 40 Hardware Layouts for LAMP Installations Yummy SQUID stats: >2800 images/sec, ~75-80% are cache hits ~10 million photos cached at any time 1.5 million cached in memory

Oct. 18, 2005# 41 Hardware Layouts for LAMP Installations The End