Google confidential │ Do not distributeGoogle confidential │ Do not distribute
Running Node.js on
Google Compute Engine
Arun Nagarajan
google.com/+ArunNagarajan
@entaq
Intro
Google Cloud Platform
Live demo
Questions
Agenda: May 8th, 2014
2
4
3
1
75
years
1957 2003 2013
500
25
years
10
years
(average age of a company
joining the S&P 500)
The decreasing cost of storage
enables virtually limitless
storage in the cloud. $600 can
buy enough storage for the
world’s music*
.
(Source: McKinsey Global Institute May 2011)
Computing as a utility is now
available for easy purchase,
provided from massively
efficient data centers.
(Source: Nicholas Carr, The Big Switch, 2008)
The internet allows for a
model of real-time access to
new innovation, information
and applications from a wide
range of devices.
Affordable
capacity
On-demand
computing
Instant
access
Big Trends
*more accurately, one could store 3.6 million music tracks at 3.5 MB each, assuming ~$50/TB HDD storage price. Noted by John Wilkes!
Google confidential | Do not distribute
“People tend to overestimate what can
be done in one year and to
underestimate what can be done in
five or ten years.”
Amara's Law
Google confidential | Do not distribute
Cloud Platform is built on the same
infrastructure that powers Google.
For the past 15 years, Google has been
building out the world’s fastest, most
powerful, highest quality infrastructure
on the planet.
Images by Connie Zhou
Wired, 'Google Throws Open Doors To Its Top Secret Data Center', October 2012
Google's Platform
"[Google's] ability to build, organize, and
operate a huge network of servers and
fiber-optic cables with an efficiency and
speed that rocks physics on its heels.
This is what makes Google Google: its
physical network, its thousands of fiber
miles, and those many thousands of servers
that, in aggregate, add up to the mother of
all clouds."
- Wired
72 hours
100 Million Gigabytes
Over 425 Million
1/4 second
Video uploaded to YouTube every minute
Google's "Caffeine" Search index, circa 2010
Number of active Gmail users
How long it takes for Google to respond to a search query
Google and Big Data
$2.9B in additional data center investments worldwide
Investing In Our Infrastructure
Store data with reliability, redundancy
and consistency
Go from data to meaning
At scale
Fast
Google white papers
Google File System (2003)
MapReduce: Simplified Data Processing on Large Clusters (2004)
BigTable: A Distributed Storage System for Structured Data (2006)
Dremel: Interactive Analysis of Web-Scale Datasets (2010)
Machine Translation (2004-2011)
2008
2010
2002
2004
2006
2012
GFS
MapReduce
Big Table
Colossus
Spanner
Dremel
FlumeJava
Pregel
What Did We Learn? To Innovate!
Application Runtimes & Services
● Iterate & deploy fast
● Scale to global demand
● Standards compliant
Data Services
● Data Intelligence
● Designed for Big Data
● High Performance
Data Storage and Distribution
● Global Resilient Architecture
● Global Edge Distribution
● Huge Secure Capacity
Global Data Centre & Networks
● Highly Resilient, Efficient & Performant
● 3rd Largest Server Manufacturer
● 2nd Largest Global Data Network
Google Research Publications referenced are available here: http://research.google.com/pubs/papers.html
Company’s ApplicationsGoogle Products etc...
App Engine,
Cloud Endpoints
BigQuery,
Flume
Cloud Storage,
Cloud SQL,
Cloud DataStore
Compute Engine,
Cloud Networking,
Cloud DNS
GRTE, Stubby,
BorgCron
Sawmill, Dremel,
MapReduce
Colossus, BlobStore,
Spanner, BigTable, F1
Borg, GFE,
GSLB, GTC
IaaS
Infrastructure-as-a-Service
PaaS
Platform-as-a-Service
SaaS
Software-as-a-Service
Cloud Computing
Managed by Companies Managed by Google
Cloud Computing
SaaS
Software-as-a-Service
Applications
Data
Runtime
Middleware
OS
Virtualization
Servers
Storage
Networking
Applications
Data
Runtime
Middleware
OS
Virtualization
Servers
Storage
Networking
Applications
Data
Runtime
Middleware
OS
Virtualization
Servers
Storage
Networking
IaaS
Infrastructure-as-a-Service
Applications
Data
Runtime
Middleware
OS
Virtualization
Servers
Storage
Networking
PaaS
Platform-as-a-Service
Packaged
Software
Google confidential │ Do not distribute
Storage
Cloud Storage Cloud SQL
Cloud
Datastore
Compute
Compute
Engine
App Engine
App Services
BigQuery
Cloud
Endpoints
Google Cloud Platform
Compute Engine
● Google’s Infrastructure-as-a-Service
● Create Linux VMs, and connect to them as you
would any other remote machine
● Static + Dynamic Addressing
● Persistent disks and snapshotting
● Live migration
● Network and firewall creation
● Load balancing
● Regional and zonal resources for high availability
Compute Engine Features
Google confidential │ Do not distribute
“Google Compute Engine is not just fast. It’s
Google fast. In fact, it’s a class of fast that
enables new service architectured entirely.”
- Sebastian Stadil, Scalr
Scalr
● Built on Chrome's JavaScript runtime
● Building fast, scalable network applications.
● Uses an event-driven, non-blocking I/O model
● Lightweight and efficient
● Perfect for data-intensive real-time applications
● Run across distributed devices.
Node.js
Google confidential │ Do not distribute
Compute Engine
Images by Connie Zhou
● console.developers.google.com
● create project
● setup billing
● Install gcloud tool -
○ curl https://sdk.cloud.google.com | bash
Compute Engine Setup
● gcloud components update compute
● gcloud auth login
● gcloud config set project eastern-button-574
● gcloud compute instances create arun-hello-world --zone europe-west1-a
● gcloud compute firewalls create allow-http --description "Incoming http allowed." --allow tcp:80
● gcloud compute ssh arun-hello-world --zone europe-west1-a
Alternatives:
● gcutil - still around but gcloud is focus
● REST API - very powerful
● UI - easy to use
Compute Engine Create Instance
Google confidential │ Do not distribute
Cloud Credit $500 Code - “dr-in”
Images by Connie Zhou
● sudo apt-get install python g++ make checkinstall
● mkdir ~/src && cd $_
● wget -N http://nodejs.org/dist/node-latest.tar.gz
● tar xzvf node-latest.tar.gz && cd node-v*
● ./configure
● sudo checkinstall (make sure to fix version)
Compute Engine node.js installation
application: my-application
runtime: go
vm: true
…
manual_scaling:
instances: 1
vm_settings:
machine_type: n1-standard-1
apt_get_install: redis-server vim
Built using Modules
https://developers.google.com/appengine/docs/python/modules/
Limited preview - https://developers.google.com/cloud/managed-vms
Managed VMs (limited preview)
Google confidential │ Do not distribute
Images by Connie Zhou

node.js on Google Compute Engine

  • 1.
    Google confidential │Do not distributeGoogle confidential │ Do not distribute Running Node.js on Google Compute Engine Arun Nagarajan google.com/+ArunNagarajan @entaq
  • 2.
    Intro Google Cloud Platform Livedemo Questions Agenda: May 8th, 2014 2 4 3 1
  • 3.
    75 years 1957 2003 2013 500 25 years 10 years (averageage of a company joining the S&P 500)
  • 4.
    The decreasing costof storage enables virtually limitless storage in the cloud. $600 can buy enough storage for the world’s music* . (Source: McKinsey Global Institute May 2011) Computing as a utility is now available for easy purchase, provided from massively efficient data centers. (Source: Nicholas Carr, The Big Switch, 2008) The internet allows for a model of real-time access to new innovation, information and applications from a wide range of devices. Affordable capacity On-demand computing Instant access Big Trends *more accurately, one could store 3.6 million music tracks at 3.5 MB each, assuming ~$50/TB HDD storage price. Noted by John Wilkes!
  • 5.
    Google confidential |Do not distribute “People tend to overestimate what can be done in one year and to underestimate what can be done in five or ten years.” Amara's Law
  • 6.
    Google confidential |Do not distribute Cloud Platform is built on the same infrastructure that powers Google. For the past 15 years, Google has been building out the world’s fastest, most powerful, highest quality infrastructure on the planet.
  • 7.
    Images by ConnieZhou Wired, 'Google Throws Open Doors To Its Top Secret Data Center', October 2012 Google's Platform "[Google's] ability to build, organize, and operate a huge network of servers and fiber-optic cables with an efficiency and speed that rocks physics on its heels. This is what makes Google Google: its physical network, its thousands of fiber miles, and those many thousands of servers that, in aggregate, add up to the mother of all clouds." - Wired
  • 8.
    72 hours 100 MillionGigabytes Over 425 Million 1/4 second Video uploaded to YouTube every minute Google's "Caffeine" Search index, circa 2010 Number of active Gmail users How long it takes for Google to respond to a search query Google and Big Data
  • 9.
    $2.9B in additionaldata center investments worldwide Investing In Our Infrastructure
  • 10.
    Store data withreliability, redundancy and consistency Go from data to meaning At scale Fast Google white papers Google File System (2003) MapReduce: Simplified Data Processing on Large Clusters (2004) BigTable: A Distributed Storage System for Structured Data (2006) Dremel: Interactive Analysis of Web-Scale Datasets (2010) Machine Translation (2004-2011) 2008 2010 2002 2004 2006 2012 GFS MapReduce Big Table Colossus Spanner Dremel FlumeJava Pregel What Did We Learn? To Innovate!
  • 11.
    Application Runtimes &Services ● Iterate & deploy fast ● Scale to global demand ● Standards compliant Data Services ● Data Intelligence ● Designed for Big Data ● High Performance Data Storage and Distribution ● Global Resilient Architecture ● Global Edge Distribution ● Huge Secure Capacity Global Data Centre & Networks ● Highly Resilient, Efficient & Performant ● 3rd Largest Server Manufacturer ● 2nd Largest Global Data Network Google Research Publications referenced are available here: http://research.google.com/pubs/papers.html Company’s ApplicationsGoogle Products etc... App Engine, Cloud Endpoints BigQuery, Flume Cloud Storage, Cloud SQL, Cloud DataStore Compute Engine, Cloud Networking, Cloud DNS GRTE, Stubby, BorgCron Sawmill, Dremel, MapReduce Colossus, BlobStore, Spanner, BigTable, F1 Borg, GFE, GSLB, GTC
  • 12.
  • 13.
    Managed by CompaniesManaged by Google Cloud Computing SaaS Software-as-a-Service Applications Data Runtime Middleware OS Virtualization Servers Storage Networking Applications Data Runtime Middleware OS Virtualization Servers Storage Networking Applications Data Runtime Middleware OS Virtualization Servers Storage Networking IaaS Infrastructure-as-a-Service Applications Data Runtime Middleware OS Virtualization Servers Storage Networking PaaS Platform-as-a-Service Packaged Software
  • 14.
    Google confidential │Do not distribute Storage Cloud Storage Cloud SQL Cloud Datastore Compute Compute Engine App Engine App Services BigQuery Cloud Endpoints Google Cloud Platform
  • 15.
  • 16.
    ● Google’s Infrastructure-as-a-Service ●Create Linux VMs, and connect to them as you would any other remote machine ● Static + Dynamic Addressing ● Persistent disks and snapshotting ● Live migration ● Network and firewall creation ● Load balancing ● Regional and zonal resources for high availability Compute Engine Features
  • 17.
    Google confidential │Do not distribute “Google Compute Engine is not just fast. It’s Google fast. In fact, it’s a class of fast that enables new service architectured entirely.” - Sebastian Stadil, Scalr Scalr
  • 18.
    ● Built onChrome's JavaScript runtime ● Building fast, scalable network applications. ● Uses an event-driven, non-blocking I/O model ● Lightweight and efficient ● Perfect for data-intensive real-time applications ● Run across distributed devices. Node.js
  • 19.
    Google confidential │Do not distribute Compute Engine Images by Connie Zhou
  • 20.
    ● console.developers.google.com ● createproject ● setup billing ● Install gcloud tool - ○ curl https://sdk.cloud.google.com | bash Compute Engine Setup
  • 21.
    ● gcloud componentsupdate compute ● gcloud auth login ● gcloud config set project eastern-button-574 ● gcloud compute instances create arun-hello-world --zone europe-west1-a ● gcloud compute firewalls create allow-http --description "Incoming http allowed." --allow tcp:80 ● gcloud compute ssh arun-hello-world --zone europe-west1-a Alternatives: ● gcutil - still around but gcloud is focus ● REST API - very powerful ● UI - easy to use Compute Engine Create Instance
  • 22.
    Google confidential │Do not distribute Cloud Credit $500 Code - “dr-in” Images by Connie Zhou
  • 23.
    ● sudo apt-getinstall python g++ make checkinstall ● mkdir ~/src && cd $_ ● wget -N http://nodejs.org/dist/node-latest.tar.gz ● tar xzvf node-latest.tar.gz && cd node-v* ● ./configure ● sudo checkinstall (make sure to fix version) Compute Engine node.js installation
  • 24.
    application: my-application runtime: go vm:true … manual_scaling: instances: 1 vm_settings: machine_type: n1-standard-1 apt_get_install: redis-server vim Built using Modules https://developers.google.com/appengine/docs/python/modules/ Limited preview - https://developers.google.com/cloud/managed-vms Managed VMs (limited preview)
  • 25.
    Google confidential │Do not distribute Images by Connie Zhou