Is Scaling PHP a pain in the ass?


You're not exactly the next Facebook, but you're big enough, and it costs real money when your site goes down in the middle of the night.

Packed with 218 pages and 80+ config files to scale your existing site.

Scale PHP 5.6 (and 7), nginx, haproxy, MySQL 5.6, Redis, and Memcache to 10K req/second

Everything I've ever learned about scaling PHP—

I slept infront of my laptop for a year while scaling Twitpic, rolling over to restart Apache at 2am before drifting back to sleep, but when you're a startup- you do what you have to do.

What if your didn't have any single points of failure? Imagine if scaling wasn't frustrating and you could get back to what you do best- shipping code?


I'm going to teach you how to scale PHP


Stop playing sysadmin and get back to coding. You didn't sign up to put out fires and figuring out how to scale MySQL isn't exactly going to ship features any faster. You know that learning the intricaces of my.cnf is a waste of time, but you don't have another choice. In the book, you'll get a crash-course on every important tuning option, why it matters, and a quick formula to figure out the perfect settings for your hardware. Bliss.

Apache is crying itself to sleep everynight

You've heard alot about Nginx and horizontal scaling, and there're thousands of tutorials out there, but the quality ranges from abysmal to "this must be a joke", and when you finally find a good one, it's usually for Rails. I know what it's like to scramble around, reading bad advice on StackOverflow, copy-and-pasting config files from some message board hope that one of them finally works... pulling at your hair, swearing at the screen.

What if it didn't have to be this way? What if there was a single, high-quality resource of information on scaling PHP, on doing things the right way, that actually focused on PHP and not Rails, Node.js or the flavor of the week? Something that taught you scalable architecture and things you might run into when your only user isn't your mom?

Learn the perfect PHP stack, LHNMPRR

Okay, okay- nothing will ever be as catchy as LAMP ;-)

You'll master a new, more scalable stack called LHNMPRR (Linux, HAProxy, Nginx, MySQL, PHP, Redis, & Resque) that can scale just by throwing more hardware at. You'll be able to finally get your setup to be perfect, all while using a battle tested stack that's been proven to handle billions of requests.

Think of it as your Cheat Code for PHP <?php ↑↑↓↓←→←→BA ?>

You'll also see the exact configurations and technologies that were used and proven at massive scale— 22 billion HTTP requests per month, thousands of MySQL queries per second— basically a metric-truck ton of visitors.

Testimonials

I bought the beta version of the book and it was already worth far more than the modest price.

Leon Atkinson
CEO, Winkpass Creations

It's an important book, you'd have to spend alot of time compiling it and testing it and learning what breaks at scale.

Willie Jackson
Director of Web Optimization, W3Edge

It's a damn good read, very useful for my new job. Setting up Nginx to play nice with PHP-FPM now.

Phil Sturgeon
PHP Contributor

Table of Contents


1. Ditching the LAMP Stack

  1. What's wrong with LAMP?
  2. The Scalable LHNMPRR Stack

2. DNS: Why you need to care

  1. DNS Load Distribution
  2. DNS Resolution

3. Load Balancing with HAProxy

  1. HAProxy Basics
  2. Configuring HAProxy
  3. Choosing the best hardware
  4. Automatic failover with keepalived
  5. Tuning linux for network heavy workload
  6. Issues at scale

4. Scaling Nginx and PHP-FPM

  1. Choosing the right version of PHP
  2. Nginx and PHP-FPM
  3. Choosing the best hardware for your application server
  4. Using a PHP Opcode cache
  5. Tuning Linux for PHP
  6. Scaling session handling

5. MySQL Tuning+Scaling Guide

  1. NoSQL Performance from MySQL
  2. Timeouts and libmysql (or how to go down for 12 hours)
  3. Tuning your MySQL Config (my.cnf)
  4. Tuning Linux for an intensive database
  5. Load Balancing MySQL Slaves
  6. Accepting master as a SPOF
  7. Understanding issues with NUMA
  8. Choosing the best hardware
  9. Online schema changes

6. Cache Server: Using Redis

  1. Redis, Memcached or APC?
  2. Redis Commands
  3. The importance of Atomic Operations
  4. Performance limitations
  5. Installing Redis from Dotdeb
  6. Installing the phpredis C extension
  7. Tuning Redis for Performance
  8. Scaling Redis to Multiple Servers
  9. Avoiding the Dogpile
  10. Russian Doll Caching
  11. Redis Bitmaps
  12. Redis Notification Feeds

7. Workers: Async Resque Workers

  1. Why use a background queue?
  2. Getting started w/ Resque and php-resque
  3. Writing a Resque Job
  4. Alternatives to Resque
  5. Things you should put in queue

8. Coding and Debugging at Scale

  1. Scaling your code
  2. Capistrano Deployment
  3. Live debugging PHP with strace

About the Author

Hey! I'm Steve Corona. I spent 5 years scaling Twitpic to handle 60 million users and 20 billion HTTP requests per month.

In the early days of Twitpic, I slept with my laptop so I could wake up and restart Apache when it crashed in the middle of the night. I had no idea what I was doing— the thing about scaling is.. you don't get to learn it until you need it. It's trial by fire.

I'm in the middle of writing "nginx: A Practical Guide to High Performance" for O'Reilly. It'll be out around September, and I'm super excited!

I live in San Francisco, CA. Follow me on Twitter (@stevencorona)

The VC-Funded Package

It's not cheap, but it includes everything, including a 1-on-1 architecture critque by me. Get all of the guides, talks, config templates... basically everything I've ever written about scaling. It's the best material on the planet for scaling a growing startup.

Scaling PHP Book

With all the great content here it might be easy to forget the book. This is the core of the entire product and is insanely valuable. You'll get the 158 page book in PDF, ePub, and Mobi format.

Architecture Critique

Send me the details of your stack and architecture and I'll critique your scalability and single points of failure.

Config Templates

A collection of 80+ of configuration templates from the book to use as a starting point (HAProxy, Nginx, PHP, and MySQL)

Scaling Memcache Handbook

Learn how to tune and tweak Memcache (and Redis) so they don't fall over in production. You'll learn how to tune the number of threads, slab size, and more.

MVC Framework Caching

If you're using a MVC Framework (Laravel, Symphony, CakePHP), you might be missing out on some huge performance gains. Most frameworks do NOT cache internal data. This guide walks you through tacking down a performance problem in an MVC framework.

HTTP & FastCGI Caching w/ Nginx

Learn what to do and (more importantly) what NOT to do when using HTTP Caching, as well as all the knobs you can turn to speed up your webapp with HTTP and FastCGI caching in Nginx.

Benchmarking & Load Testing Your PHP Code

Put the rubber to the road and impress your users by actualling TRACKING how well your webapp is performing. The truth is, most poeple don't know which tools to use or even where to start benchmarking.

"Scaling LAMP doesn't have to suck"

Get a professional recording of a talk I gave about Scaling PHP, Scaling LAMP doesn't have to suck. Includes new topics, like using NSQ for queuing.

How DNS is your Secret Single-Point-of-Failure

Most of us have a secret lurking.. a single-point-of-failure that isn't even on the radar. In this guide, you'll learn how to mitigate against DNS resolution ruining a full night of sleep.

Async APIs & Background Jobs w/ PHP

Learn the best way to implement backgrounding and asynchronous workers in PHP to make your webapp run faster and offload more work the background.

Horizontally Scaling 1 Million File Uploads

What if you had to handle 1 million file uploads in PHP? How would you do it? Where would you start? How would you architect your storage? File processing? This guide teaches you exactly how.

MySQL Hot Backups in Production

Traditional MySQL backups are unforgiving and nearly impossible to do without shuttind down the database. In this guide, I'll teach you how to backup TBs of MySQL data on a live server with open-source tools.

Resizing 100 Images/Sec

Advanced in-depth tuning on getting PHP to process (and resize) hundreds of images per second in PHP. I walk you through a crazy-advanced setup that tweaks the nginx buffer cache, filesystem, and GraphicsMagick to squeeze out every last drop.

$59 Buy Now

The Pro Package

The BEST option for individuals or companies just getting started. Includes all of the best material and most of the guides to help you scale your app in the real world.

Scaling PHP Book

With all the great content here it might be easy to forget the book. This is the core of the entire product and is insanely valuable. You'll get the 158 page book in PDF, ePub, and Mobi format.

Config Templates

A collection of 80+ of configuration templates from the book to use as a starting point (HAProxy, Nginx, PHP, and MySQL)

Scaling Memcache Handbook

Learn how to tune and tweak Memcache (and Redis) so they don't fall over in production. You'll learn how to tune the number of threads, slab size, and more.

MVC Framework Caching

If you're using a MVC Framework (Laravel, Symphony, CakePHP), you might be missing out on some huge performance gains. Most frameworks do NOT cache internal data. This guide walks you through tacking down a performance problem in an MVC framework.

"Scaling LAMP doesn't have to suck"

Get a professional recording of a talk I gave about Scaling PHP, Scaling LAMP doesn't have to suck. Includes new topics, like using NSQ for queuing.

How DNS is your Secret Single-Point-of-Failure

Most of us have a secret lurking.. a single-point-of-failure that isn't even on the radar. In this guide, you'll learn how to mitigate against DNS resolution ruining a full night of sleep.

Async APIs & Background Jobs w/ PHP

Learn the best way to implement backgrounding and asynchronous workers in PHP to make your webapp run faster and offload more work the background.

MySQL Hot Backups in Production

Traditional MySQL backups are unforgiving and nearly impossible to do without shuttind down the database. In this guide, I'll teach you how to backup TBs of MySQL data on a live server with open-source tools.

Resizing 100 Images/Sec

Advanced in-depth tuning on getting PHP to process (and resize) hundreds of images per second in PHP. I walk you through a crazy-advanced setup that tweaks the nginx buffer cache, filesystem, and GraphicsMagick to squeeze out every last drop.

$39 Buy Now

Just The Book

The basic option is still great!

If you only want to learn the fundamentals, if you're on a budget, you won't regret investing in the core 158 page eBook. The book is delivered instantly in PDF, ePub, and Mobi format.

Get a free chapter from the book


Want to check out the book before buying? Just tell me where to send the entire first chapter— I'll let you check it out for free.

It's your choice, you can spend 2 years learning this stuff on your own, or I can guide you through it in a weekend.

Backed by my Unconditional, No Risk, 100% Happiness Guarentee

You can get a 100% refund, no questions asked, forever. It's as simple as this— if you're not happy, I don't deserve your money. I've sold over 5000 copies and only 7 people have asked for a refund.

Package Comparison

Just The Book

  1. 158 Page PDF/ePub/Mobi
  2. Free Updates for Life
Get it now for $39

Pro Package

  1. 158 Page PDF/ePub/Mobi
  2. Config Templates
  3. Free Updates for Life
  4. Config Templates
  5. Scaling LAMP doesn't have to suck

Guides/Case Studies

  1. Scaling Memcache Handbook
  2. MySQL Hot Backups in Production
  3. Resizing 100 Images/Second
  4. How DNS is your Secret Single-Point-of-Failure
  5. Async APIs & Background Jobs w/ PHP
  6. MVC Framework Caching
Get it now for $59

The VC-Funded Package

  1. 158 Page PDF/ePub/Mobi
  2. Config Templates
  3. Free Updates for Life
  4. Config Templates
  5. Scaling LAMP doesn't have to suck

Architecture Critque

Send me the details of your stack and architecture and I'll critique your scalability and single points of failure.


Guides/Case Studies

  1. Scaling Memcache Handbook
  2. MySQL Hot Backups in Production
  3. Resizing 100 Images/Second
  4. How DNS is your Secret Single-Point-of-Failure
  5. Async APIs & Background Jobs w/ PHP
  6. MVC Framework Caching
  7. HTTP & FastCGI Caching w/ Nginx
  8. Benchmarking & Load Testing your PHP Code
  9. Horizontally scaling 1 Million File Uploads
Get it now for $249

Questions?

Can I upgrade later?

Yes, the last page of the book contains links to upgrade to the basic and complete packages.

What format does the book come in?

The book comes in ePub, PDF, and Mobi format. It works great with eReaders like the iPad and Kindle, or read it on your desktop.

What if I hate it?

I've sold over 2,000 copies and only 3 people have asked for a refund. The odds are high that you'll love it, but just in case, you have 60 days to get a full refund.

Is the book ready for PHP 7?

Absolutely. While the book is targeted at all of the modern versions of PHP, it specifically focused for people using PHP 5.6 and 7. It also includes hard-to-find information about the Zend Opcache and APC changes.

Is it suitable for beginners?

Yup, but you should already know PHP and some Linux basics. I try hard to guide you through the server stuff, but you'll need to know how to login to a server with SSH and run apt-get.

Can I still use MySQL?

Duh! I do touch a little bit on NoSQL, but I'm a huge fan of MySQL and show you how to scale it to make it faster and more redundant.

Still not ready to buy?


It's your choice, you can spend 2 years learning this stuff on your own instead. If you're still not convinced, let me send you a free chapter from the book— no obligation.