43
Moving to the Cloud with NYTimes.com Ben Gerst Vadim Jelezniakov OSCON 2010 Friday, August 13, 2010

Moving to the Cloud with NYTimes.com

Embed Size (px)

DESCRIPTION

The community platform at The New York Times is a PHP-based, multi-tiered application that utilizes MySQL, Apache and Memcached. It was originally hosted on our own internal servers. We recently moved the platform to the cloud in order to increase its flexibility and to better handle high-load events (like links from the Yahoo home page). Moving an existing application to the cloud presented both organizational and technical challenges. We discuss our adventures in the cloud so far. Topics will include cloud management, auto-scaling and deployment on the cloud.

Citation preview

Page 1: Moving to the Cloud with NYTimes.com

Moving to the Cloudwith NYTimes.com

Ben GerstVadim Jelezniakov

OSCON 2010

Friday, August 13, 2010

Page 2: Moving to the Cloud with NYTimes.com

Vanilla AWS - Do Everything Yourself

Choose / Build Images

‘Slice’ Your Resources

Store Meta Data

Define Process

etc.

Friday, August 13, 2010

Page 3: Moving to the Cloud with NYTimes.com

Great For Start-Ups

Nothing to Lose,Everything to Gain

Friday, August 13, 2010

Page 4: Moving to the Cloud with NYTimes.com

Difficult forGrown-Ups

Friday, August 13, 2010

Page 5: Moving to the Cloud with NYTimes.com

Difficult forGrown-Ups

Like a 150 y.o.Newspaper with a14 y.o. Web Site

and a 3 y.o. buildingthat the guy on the right

climbed in 2008

Friday, August 13, 2010

Page 6: Moving to the Cloud with NYTimes.com

But First...Why Move?

Ben talks aboutCommunity

Calls at 6PM on Fridayand Beer

Friday, August 13, 2010

Page 7: Moving to the Cloud with NYTimes.com

What is UGC @nytimes?

Friday, August 13, 2010

Page 8: Moving to the Cloud with NYTimes.com

Comments on Articles and Blogs

Friday, August 13, 2010

Page 9: Moving to the Cloud with NYTimes.com

Rate and Review for Movies, Theater, Dining and Travel

Friday, August 13, 2010

Page 10: Moving to the Cloud with NYTimes.com

once upon a time...

Friday, August 13, 2010

Page 11: Moving to the Cloud with NYTimes.com

Friday, August 13, 2010

Page 12: Moving to the Cloud with NYTimes.com

hmm...

• need to be able to scale quickly on demand

•we don’t like calls from systems at 6pm on Fridays

Friday, August 13, 2010

Page 13: Moving to the Cloud with NYTimes.com

buy more hardware

You've been down there, Neo. You already know that road. You know exactly where it ends.

Friday, August 13, 2010

Page 14: Moving to the Cloud with NYTimes.com

move to the cloud

Friday, August 13, 2010

Page 15: Moving to the Cloud with NYTimes.com

traffic spikes - add capacity

Friday, August 13, 2010

Page 16: Moving to the Cloud with NYTimes.com

traffic spikes - add capacity

Friday, August 13, 2010

Page 17: Moving to the Cloud with NYTimes.com

nytimes.com community architecture circa. 2007

Friday, August 13, 2010

Page 18: Moving to the Cloud with NYTimes.com

ugc architecture

Friday, August 13, 2010

Page 19: Moving to the Cloud with NYTimes.com

gap analysis

• load balancing?

• how do we manage communication between instances? what about talking back to the datacenter?

• how do we scale up and back?

• how do we secure the instances?

Friday, August 13, 2010

Page 20: Moving to the Cloud with NYTimes.com

nginx

• elastic ip points to nginx which handles all of our traffic

• nginx has the rules which determine where to send requests

Friday, August 13, 2010

Page 21: Moving to the Cloud with NYTimes.com

communication & scaling

• host files

• monit

Friday, August 13, 2010

Page 22: Moving to the Cloud with NYTimes.com

security groups

cmty-fe cmty-apicmty-cache

cmty-mysql

cmty

production

Friday, August 13, 2010

Page 23: Moving to the Cloud with NYTimes.com

monitoring

Friday, August 13, 2010

Page 24: Moving to the Cloud with NYTimes.com

development instances!

Friday, August 13, 2010

Page 25: Moving to the Cloud with NYTimes.com

Grown-Ups:Existing Organization

Software Developers

QA Specialists

Management

Infrastructure Engineers

System Administrators

Friday, August 13, 2010

Page 26: Moving to the Cloud with NYTimes.com

Grown-Ups:Existing Process

Development

QA

Staging

Production

Security / Compliance

Friday, August 13, 2010

Page 27: Moving to the Cloud with NYTimes.com

Grown-Ups:Existing

Infrastructure

Authentication

Source Control

Monitoring

Network Security

Friday, August 13, 2010

Page 28: Moving to the Cloud with NYTimes.com

No Auth Hooks

No Slices (Subaccounts)*

No Monitoring Hooks

Expensive*

Other Cloud Managers

Friday, August 13, 2010

Page 29: Moving to the Cloud with NYTimes.com

NimbulLight Cloud Managerhttp://github.com/nimbul/nimbul

CloudSourceSimple SVN Deploymenthttp://github.com/nimbul/cloudsourcebased on ServerMattic developed by WordPress

EmissaryFast AMQP Messaginghttp://github.com/nimbul/emissary

Friday, August 13, 2010

Page 30: Moving to the Cloud with NYTimes.com

Nimbul

Meta Data Store

Configuration Management

Access Control

Publishers

Sane Auto-Scaling UI

F2WW

Friday, August 13, 2010

Page 31: Moving to the Cloud with NYTimes.com

Nimbul Cloud

Providers( EC2 )

Provider Accounts( Dev, Staging, Production )

Clusters (“Slices”)( UGC Staging, WWW Production )

Server Profiles( UGC FrontEnd, UGC MySQL Master )

Instances

Friday, August 13, 2010

Page 32: Moving to the Cloud with NYTimes.com

Nimbul Users

Nimbul Admins( Full Access, can’t read keys )

Provider Account Admins( Control Users, Resources, Env Vars, Startup Scripts, etc )

Cluster (“Slice”) Admins( Control Users, Resources, Env Vars, Startup Scripts, etc )

SSH Users( Can be granted SSH access to any running instance )

Before Nimbul

After Nimbul

Friday, August 13, 2010

Page 33: Moving to the Cloud with NYTimes.com

Extending Existing Infrastructureto the Cloud

Friday, August 13, 2010

Page 34: Moving to the Cloud with NYTimes.com

Friday, August 13, 2010

Page 35: Moving to the Cloud with NYTimes.com

Friday, August 13, 2010

Page 36: Moving to the Cloud with NYTimes.com

Friday, August 13, 2010

Page 37: Moving to the Cloud with NYTimes.com

Friday, August 13, 2010

Page 38: Moving to the Cloud with NYTimes.com

Friday, August 13, 2010

Page 39: Moving to the Cloud with NYTimes.com

Friday, August 13, 2010

Page 40: Moving to the Cloud with NYTimes.com

Friday, August 13, 2010

Page 41: Moving to the Cloud with NYTimes.com

CloudSourceSVN + bash

Role in SVN: files/ etc/ my.cnf <svn:external opt/nyt/app> scripts/ install.sh

Deploy: role.sh apply role1,role2,role3

Update: role.sh update role

Friday, August 13, 2010

Page 42: Moving to the Cloud with NYTimes.com

Friday, August 13, 2010

Page 43: Moving to the Cloud with NYTimes.com

NimbulLight Cloud Managerhttp://github.com/nimbul/nimbul

CloudSourceSimple SVN Deploymenthttp://github.com/nimbul/cloudsourcebased on ServerMattic developed by WordPress

EmissaryFast AMQP Messaginghttp://github.com/nimbul/emissary

Friday, August 13, 2010