SlideShare ist ein Scribd-Unternehmen logo
1 von 63
Downloaden Sie, um offline zu lesen
Go After 4 Years in Production
Travis Reeder - Co-Founder and CTO of Iron.io
Part 1:
In the Beginning
6 Years Ago
We started a consulting company.
Built software for smart hardware companies (IoT).
Had to collect, process and report on large, constant streams of data.
DIY job processing.
5 Years Ago
We built our own multi-tenant, job processing system on the cloud.
It enabled us to develop projects faster and with less maintenance.
Good for us, good for our customers.
4 Years Ago
“There must be other developers that have the same problem???”
So we released our new service to the public:
Houston, We Have a Problem
We wrote it in Ruby.
Ruby was
Ruby for our API
We tried to keep CPU usage < 50% across our servers.
When it increased beyond that, we’d launch more servers to keep it around 50%.
This is fine if you don’t mind spending money.
What Amazon thought of us
The Bigger Problem - Traffic Spikes
Traffic spikes caused CPU levels to spike.
At some threshold above 50% CPU, a server would spike up to 100%.
100% == unresponsive
Load balancer removes server from pool.
Load distributed to remaining servers.
Dominoes
More load on remaining machines => more servers unresponsive => more servers
taken offline. => repeat...
Colossal Clusterf**k
Colossal Clusterf**k Visualized
When your API goes down
What To Do? What To Do?
1) Spend more money for extra capacity
2) Rewrite it
Part 2:
Choosing Go
Choosing a Language
We looked at other scripting languages with better performance than Ruby (wasn’t
hard).
We looked at Java and derivatives like Scala and Clojure
We looked at Go.
Why We Chose Go
● Concurrency being a fundamental part of the language
● Standard library had almost everything we needed
● It’s terse
● It’s compiled
● It compiles fast
● It runs fast
● Google is behind it
● It’s fun (like Ruby)
Concurrency in Go
2 Main Concurrency Features:
Goroutines and Channels
A goroutine is like a super light weight thread.
Running hundreds of thousands of goroutines is no problem (unlike threads).
You don’t need to think much about them (unlike threads).
Goroutines are multiplexed onto threads behind the scenes.
Goroutines
Easy to use:
To run function in a goroutine:
Goroutines
func hello(name string) {
fmt.Println("Hello", name)
}
go hello("Travis")
Channels
Channels allow you to communicate between goroutines.
Without having to worry about synchronization (locks, deadlocks, etc).
Channels
c := make(chan string)
go hello("Travis", c)
for i := 0; i < 5; i++ {
fmt.Printf("You say: %qn", <-c) // receive
}
func hello(name string, c chan string) {
for i := 0; ; i++ {
c <- fmt.Sprintf("Hello %s %d", name, i) // send
}
}
Quote - Rob Pike - 2011
“We realized that the kind of software we build at Google is not
always served well by the languages we had available. Robert
Griesemer, Ken Thompson, and myself decided to make a
language that would be very good for writing the kinds of
programs we write at Google.”
Why not X?
I got asked a lot: “why didn’t you use language X”?
Why not Python?
Seems logical coming from Ruby, but:
● Not compiled (more error prone)
● Indentation based code (more error prone)
● Not as fast as Go
Go vs Python Benchmark
Why not Node?
JavaScript
When people tell me to use Node
JavaScript V8 is actually very fast
But it’s still JavaScript.
Why not Java (or a derivative)?
After many, many years of using Java, I didn’t want to go back to the JVM.
Go was more interesting and exciting.
Even though Java is still faster.
Go vs Java Benchmark
Why not Ruby?
Some people asked why we didn’t just try to optimize Ruby.
I’m sure we could have done a lot better had we not used Rails.
But even so, there’s no comparison:
Go vs Ruby
It Was a Risky Decision
● New technology, not proven
● There wasn’t a big community
● There wasn’t a lot of open source projects
● There weren’t any success stories of production usage
● We weren’t sure if we could hire top talent
● We were one of the first companies to publicly say we were using it
● We were the first company to post a Go job
● It wasn’t even at a 1.0 release
When we told our investors we wanted to rewrite in Go
Replaced API with Go
Exact same API.
Exact same functionality.
We went from 30
servers to 2
30 Servers to 2
The 2nd one was just for redundancy.
We were barely utilizing the machines (barely registered CPU).
We never had a colossal CF again.
When you reduce your server count by 10x
Part 3:
4 Years Later
Performance
Performance has been stellar.
We still only run a few servers for each of our API clusters… after 4 years of growth!
Go has never been our bottleneck, it’s always something else (ie: database).
Memory
No virtual machine - starts fast and small.
IronMQ starts up in 6.5MB of resident memory including configuration, making
connections, etc.
Four years in, we’ve never had a memory leak or problems related to memory.
Reliability
Hard to quantify, but…
Our Go applications are very robust.
Rarely have a failure/crash that wasn’t related to some external problem.
Code tends to be cleaner and higher quality.
Strict compiler.
Do a lot with a small amount of code.
Deployment
Go compiles into a single, static binary file.
Deployment is simply putting that file on a server and starting it up.
No dependencies required.
No runtime required.
Binary is small. (IronMQ is ~6MB)
Rolling Back
Since it’s a single binary, you just stop the process and start the previous binary.
No need to worry about dependencies changing.
Language and Tooling
Keeps getting better and better.
Better garbage collection.
Better tools (for debugging, etc).
More open source libraries.
Talent
When we first started, there were very few people that knew the language.
We didn’t know if we’d be able to hire anybody!
But people really want to work with Go.
The caliber of talent that want to work for Iron.io is amazing.
When I think about Go
Part 4:
The Growth of Go
6 Years Old
6 years and 6 days ago, the Go project was released. - Nov. 10, 2009
3.5 years ago, Go 1.0 was released. - March 28, 2012
Trends
Trends
Community
Production Usage
4 years ago, nobody was using it in production (except maybe Google… and us).
Today, almost every startup I talk to is using it in some way or another.
And a lot of the big guys are using it now too.
Who’s Using Go Now?
Thousands of engineers writing Go code.
Millions of lines of Go source in the Google codebase.
High-profile and/or open source projects:
● Kubernetes
● Vitess.io
● Google Data Saver
● The unannounced Vanadium project - https://v.io/ - source code here: https:
//github.com/vanadium
Who’s Using Go Now?
Contributing to compilation and runtime for the Go language.
Looking to expose more Intel platform features through Go libraries.
Prototyping cloud ecosystem projects using Go.
Hosting Golang training workshops for Women In Technology.
Who’s Using Go Now?
Replaced entire HTTP serving infrastructure with a Go stack.
> 100B requests per day.
~ 1.15M queries per second.
Who’s Using Go Now?
Docker and all the Docker tools are written entirely in Go.
Docker announced at GoSF:
Who’s Using Go Now?
#2 language (#1 being Ruby).
Services using Go:
● Dashboard metrics
● System metrics
● Logging system
● ‘git push heroku master’: The ssh server behind this is written in Go.
● Postgres server monitoring
“We're an infrastructure company and Go lends itself well to writing infrastructure
code.” -- Edward Mueller
Who’s Using Go Now?
Who’s Using Go Now?
Server-side is 100% Go.
Including real-time chat service.
> 50M active users.
13 billion minutes/month.
Conclusion
We took a risk and it paid off.
We love the language, and it’s loved us back.
Usage is growing super fast.
A lot of companies are already using it for critical parts of their production systems.
Conclusion
2 years ago I wrote: “Is Go the next gen language we’ve been waiting for? It’s a bit too
early to say, but it’s certainly off to a good start.“
Today: Yes it is. Go IS the language for the cloud.
If you’re writing API’s or infrastructure, it should be at the top of your list.
Is Go the new Java? It’s a bit too early to say, but it’s certainly off to a good start.
Thanks!
Travis Reeder
@treeder
travis@iron.io

Weitere ähnliche Inhalte

Was ist angesagt?

Powering tensorflow with big data (apache spark, flink, and beam) dataworks...
Powering tensorflow with big data (apache spark, flink, and beam)   dataworks...Powering tensorflow with big data (apache spark, flink, and beam)   dataworks...
Powering tensorflow with big data (apache spark, flink, and beam) dataworks...Holden Karau
 
Writing a fast HTTP parser
Writing a fast HTTP parserWriting a fast HTTP parser
Writing a fast HTTP parserfukamachi
 
Docker for Developers - PHP Detroit 2018
Docker for Developers - PHP Detroit 2018Docker for Developers - PHP Detroit 2018
Docker for Developers - PHP Detroit 2018Chris Tankersley
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for DevelopmentChris Tankersley
 
Redesigning Common Lisp
Redesigning Common LispRedesigning Common Lisp
Redesigning Common Lispfukamachi
 
Using PHP Functions! (Not those functions, Google Cloud Functions)
Using PHP Functions! (Not those functions, Google Cloud Functions)Using PHP Functions! (Not those functions, Google Cloud Functions)
Using PHP Functions! (Not those functions, Google Cloud Functions)Chris Tankersley
 
Data Science Apps: Beyond Notebooks - Natalino Busa - Codemotion Amsterdam 2017
Data Science Apps: Beyond Notebooks - Natalino Busa - Codemotion Amsterdam 2017Data Science Apps: Beyond Notebooks - Natalino Busa - Codemotion Amsterdam 2017
Data Science Apps: Beyond Notebooks - Natalino Busa - Codemotion Amsterdam 2017Codemotion
 
Prophet - Beijing Perl Workshop
Prophet - Beijing Perl WorkshopProphet - Beijing Perl Workshop
Prophet - Beijing Perl WorkshopJesse Vincent
 
Getting Git Right
Getting Git RightGetting Git Right
Getting Git RightSven Peters
 
Dexador Rises
Dexador RisesDexador Rises
Dexador Risesfukamachi
 
javerosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonjaverosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonDomingo Suarez Torres
 
But we're already open source! Why would I want to bring my code to Apache?
But we're already open source! Why would I want to bring my code to Apache?But we're already open source! Why would I want to bring my code to Apache?
But we're already open source! Why would I want to bring my code to Apache?gagravarr
 
Powering tensor flow with big data using apache beam, flink, and spark cern...
Powering tensor flow with big data using apache beam, flink, and spark   cern...Powering tensor flow with big data using apache beam, flink, and spark   cern...
Powering tensor flow with big data using apache beam, flink, and spark cern...Holden Karau
 
Making the big data ecosystem work together with python apache arrow, spark,...
Making the big data ecosystem work together with python  apache arrow, spark,...Making the big data ecosystem work together with python  apache arrow, spark,...
Making the big data ecosystem work together with python apache arrow, spark,...Holden Karau
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCTim Burks
 
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...Codemotion
 
The Parenscript Common Lisp to JavaScript compiler
The Parenscript Common Lisp to JavaScript compilerThe Parenscript Common Lisp to JavaScript compiler
The Parenscript Common Lisp to JavaScript compilerVladimir Sedach
 
Automating Your Workflow with Gulp.js - php[world] 2016
Automating Your Workflow with Gulp.js - php[world] 2016Automating Your Workflow with Gulp.js - php[world] 2016
Automating Your Workflow with Gulp.js - php[world] 2016Colin O'Dell
 
Queick: A Simple Job Queue System for Python
Queick: A Simple Job Queue System for PythonQueick: A Simple Job Queue System for Python
Queick: A Simple Job Queue System for PythonRyota Suenaga
 
Asynchronous job queues with python-rq
Asynchronous job queues with python-rqAsynchronous job queues with python-rq
Asynchronous job queues with python-rqAshish Acharya
 

Was ist angesagt? (20)

Powering tensorflow with big data (apache spark, flink, and beam) dataworks...
Powering tensorflow with big data (apache spark, flink, and beam)   dataworks...Powering tensorflow with big data (apache spark, flink, and beam)   dataworks...
Powering tensorflow with big data (apache spark, flink, and beam) dataworks...
 
Writing a fast HTTP parser
Writing a fast HTTP parserWriting a fast HTTP parser
Writing a fast HTTP parser
 
Docker for Developers - PHP Detroit 2018
Docker for Developers - PHP Detroit 2018Docker for Developers - PHP Detroit 2018
Docker for Developers - PHP Detroit 2018
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for Development
 
Redesigning Common Lisp
Redesigning Common LispRedesigning Common Lisp
Redesigning Common Lisp
 
Using PHP Functions! (Not those functions, Google Cloud Functions)
Using PHP Functions! (Not those functions, Google Cloud Functions)Using PHP Functions! (Not those functions, Google Cloud Functions)
Using PHP Functions! (Not those functions, Google Cloud Functions)
 
Data Science Apps: Beyond Notebooks - Natalino Busa - Codemotion Amsterdam 2017
Data Science Apps: Beyond Notebooks - Natalino Busa - Codemotion Amsterdam 2017Data Science Apps: Beyond Notebooks - Natalino Busa - Codemotion Amsterdam 2017
Data Science Apps: Beyond Notebooks - Natalino Busa - Codemotion Amsterdam 2017
 
Prophet - Beijing Perl Workshop
Prophet - Beijing Perl WorkshopProphet - Beijing Perl Workshop
Prophet - Beijing Perl Workshop
 
Getting Git Right
Getting Git RightGetting Git Right
Getting Git Right
 
Dexador Rises
Dexador RisesDexador Rises
Dexador Rises
 
javerosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonjaverosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparison
 
But we're already open source! Why would I want to bring my code to Apache?
But we're already open source! Why would I want to bring my code to Apache?But we're already open source! Why would I want to bring my code to Apache?
But we're already open source! Why would I want to bring my code to Apache?
 
Powering tensor flow with big data using apache beam, flink, and spark cern...
Powering tensor flow with big data using apache beam, flink, and spark   cern...Powering tensor flow with big data using apache beam, flink, and spark   cern...
Powering tensor flow with big data using apache beam, flink, and spark cern...
 
Making the big data ecosystem work together with python apache arrow, spark,...
Making the big data ecosystem work together with python  apache arrow, spark,...Making the big data ecosystem work together with python  apache arrow, spark,...
Making the big data ecosystem work together with python apache arrow, spark,...
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPC
 
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
 
The Parenscript Common Lisp to JavaScript compiler
The Parenscript Common Lisp to JavaScript compilerThe Parenscript Common Lisp to JavaScript compiler
The Parenscript Common Lisp to JavaScript compiler
 
Automating Your Workflow with Gulp.js - php[world] 2016
Automating Your Workflow with Gulp.js - php[world] 2016Automating Your Workflow with Gulp.js - php[world] 2016
Automating Your Workflow with Gulp.js - php[world] 2016
 
Queick: A Simple Job Queue System for Python
Queick: A Simple Job Queue System for PythonQueick: A Simple Job Queue System for Python
Queick: A Simple Job Queue System for Python
 
Asynchronous job queues with python-rq
Asynchronous job queues with python-rqAsynchronous job queues with python-rq
Asynchronous job queues with python-rq
 

Ähnlich wie Go After 4 Years in Production - QCon 2015

Beyond the Hype: 4 Years of Go in Production
Beyond the Hype: 4 Years of Go in ProductionBeyond the Hype: 4 Years of Go in Production
Beyond the Hype: 4 Years of Go in ProductionC4Media
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Gozhubert
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go langAmal Mohan N
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to GoSimon Hewitt
 
Apcera Case Study: The selection of the Go language
Apcera Case Study: The selection of the Go languageApcera Case Study: The selection of the Go language
Apcera Case Study: The selection of the Go languageDerek Collison
 
Scaling Up Lookout
Scaling Up LookoutScaling Up Lookout
Scaling Up LookoutLookout
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Ganesh Samarthyam
 
A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageGanesh Samarthyam
 
Hadoop at Yahoo! -- University Talks
Hadoop at Yahoo! -- University TalksHadoop at Yahoo! -- University Talks
Hadoop at Yahoo! -- University Talksyhadoop
 
From Ant to Rake
From Ant to RakeFrom Ant to Rake
From Ant to Rakejazzman1980
 
The story of language development
The story of language developmentThe story of language development
The story of language developmentHiroshi SHIBATA
 
At&T Interactive: The Many Facets Of Ruby
At&T Interactive: The Many Facets Of RubyAt&T Interactive: The Many Facets Of Ruby
At&T Interactive: The Many Facets Of RubyCoby Randquist
 
Java And Community Support
Java And Community SupportJava And Community Support
Java And Community SupportWilliam Grosso
 
Rapidly Building and Deploying Scalable Web Architectures
Rapidly Building and Deploying Scalable Web ArchitecturesRapidly Building and Deploying Scalable Web Architectures
Rapidly Building and Deploying Scalable Web ArchitecturesKeith Fitzgerald
 
Message Queues in Ruby - An Overview
Message Queues in Ruby - An OverviewMessage Queues in Ruby - An Overview
Message Queues in Ruby - An OverviewPradeep Elankumaran
 

Ähnlich wie Go After 4 Years in Production - QCon 2015 (20)

Beyond the Hype: 4 Years of Go in Production
Beyond the Hype: 4 Years of Go in ProductionBeyond the Hype: 4 Years of Go in Production
Beyond the Hype: 4 Years of Go in Production
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
ruby pentest
ruby pentestruby pentest
ruby pentest
 
Apcera Case Study: The selection of the Go language
Apcera Case Study: The selection of the Go languageApcera Case Study: The selection of the Go language
Apcera Case Study: The selection of the Go language
 
Scaling Up Lookout
Scaling Up LookoutScaling Up Lookout
Scaling Up Lookout
 
Why Go Lang?
Why Go Lang?Why Go Lang?
Why Go Lang?
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction
 
A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming Language
 
Hadoop at Yahoo! -- University Talks
Hadoop at Yahoo! -- University TalksHadoop at Yahoo! -- University Talks
Hadoop at Yahoo! -- University Talks
 
Go Revel Gooo...
Go Revel Gooo...Go Revel Gooo...
Go Revel Gooo...
 
From Ant to Rake
From Ant to RakeFrom Ant to Rake
From Ant to Rake
 
The story of language development
The story of language developmentThe story of language development
The story of language development
 
At&T Interactive: The Many Facets Of Ruby
At&T Interactive: The Many Facets Of RubyAt&T Interactive: The Many Facets Of Ruby
At&T Interactive: The Many Facets Of Ruby
 
Golang
GolangGolang
Golang
 
Java And Community Support
Java And Community SupportJava And Community Support
Java And Community Support
 
NodeJS and what is actually does
NodeJS and what is actually doesNodeJS and what is actually does
NodeJS and what is actually does
 
Rapidly Building and Deploying Scalable Web Architectures
Rapidly Building and Deploying Scalable Web ArchitecturesRapidly Building and Deploying Scalable Web Architectures
Rapidly Building and Deploying Scalable Web Architectures
 
Message Queues in Ruby - An Overview
Message Queues in Ruby - An OverviewMessage Queues in Ruby - An Overview
Message Queues in Ruby - An Overview
 

Kürzlich hochgeladen

Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile EnvironmentVictorSzoltysek
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 

Kürzlich hochgeladen (20)

Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 

Go After 4 Years in Production - QCon 2015

  • 1. Go After 4 Years in Production Travis Reeder - Co-Founder and CTO of Iron.io
  • 2. Part 1: In the Beginning
  • 3. 6 Years Ago We started a consulting company. Built software for smart hardware companies (IoT). Had to collect, process and report on large, constant streams of data. DIY job processing.
  • 4. 5 Years Ago We built our own multi-tenant, job processing system on the cloud. It enabled us to develop projects faster and with less maintenance. Good for us, good for our customers.
  • 5. 4 Years Ago “There must be other developers that have the same problem???” So we released our new service to the public:
  • 6. Houston, We Have a Problem We wrote it in Ruby. Ruby was
  • 7. Ruby for our API We tried to keep CPU usage < 50% across our servers. When it increased beyond that, we’d launch more servers to keep it around 50%. This is fine if you don’t mind spending money.
  • 9. The Bigger Problem - Traffic Spikes Traffic spikes caused CPU levels to spike. At some threshold above 50% CPU, a server would spike up to 100%. 100% == unresponsive Load balancer removes server from pool. Load distributed to remaining servers.
  • 10. Dominoes More load on remaining machines => more servers unresponsive => more servers taken offline. => repeat... Colossal Clusterf**k
  • 12. When your API goes down
  • 13. What To Do? What To Do? 1) Spend more money for extra capacity 2) Rewrite it
  • 15. Choosing a Language We looked at other scripting languages with better performance than Ruby (wasn’t hard). We looked at Java and derivatives like Scala and Clojure We looked at Go.
  • 16. Why We Chose Go ● Concurrency being a fundamental part of the language ● Standard library had almost everything we needed ● It’s terse ● It’s compiled ● It compiles fast ● It runs fast ● Google is behind it ● It’s fun (like Ruby)
  • 17. Concurrency in Go 2 Main Concurrency Features: Goroutines and Channels
  • 18. A goroutine is like a super light weight thread. Running hundreds of thousands of goroutines is no problem (unlike threads). You don’t need to think much about them (unlike threads). Goroutines are multiplexed onto threads behind the scenes. Goroutines
  • 19. Easy to use: To run function in a goroutine: Goroutines func hello(name string) { fmt.Println("Hello", name) } go hello("Travis")
  • 20. Channels Channels allow you to communicate between goroutines. Without having to worry about synchronization (locks, deadlocks, etc).
  • 21. Channels c := make(chan string) go hello("Travis", c) for i := 0; i < 5; i++ { fmt.Printf("You say: %qn", <-c) // receive } func hello(name string, c chan string) { for i := 0; ; i++ { c <- fmt.Sprintf("Hello %s %d", name, i) // send } }
  • 22. Quote - Rob Pike - 2011 “We realized that the kind of software we build at Google is not always served well by the languages we had available. Robert Griesemer, Ken Thompson, and myself decided to make a language that would be very good for writing the kinds of programs we write at Google.”
  • 23. Why not X? I got asked a lot: “why didn’t you use language X”?
  • 24. Why not Python? Seems logical coming from Ruby, but: ● Not compiled (more error prone) ● Indentation based code (more error prone) ● Not as fast as Go
  • 25. Go vs Python Benchmark
  • 27. When people tell me to use Node
  • 28. JavaScript V8 is actually very fast But it’s still JavaScript.
  • 29. Why not Java (or a derivative)? After many, many years of using Java, I didn’t want to go back to the JVM. Go was more interesting and exciting. Even though Java is still faster.
  • 30. Go vs Java Benchmark
  • 31. Why not Ruby? Some people asked why we didn’t just try to optimize Ruby. I’m sure we could have done a lot better had we not used Rails. But even so, there’s no comparison:
  • 33. It Was a Risky Decision ● New technology, not proven ● There wasn’t a big community ● There wasn’t a lot of open source projects ● There weren’t any success stories of production usage ● We weren’t sure if we could hire top talent ● We were one of the first companies to publicly say we were using it ● We were the first company to post a Go job ● It wasn’t even at a 1.0 release
  • 34. When we told our investors we wanted to rewrite in Go
  • 35. Replaced API with Go Exact same API. Exact same functionality.
  • 36. We went from 30 servers to 2
  • 37. 30 Servers to 2 The 2nd one was just for redundancy. We were barely utilizing the machines (barely registered CPU). We never had a colossal CF again.
  • 38. When you reduce your server count by 10x
  • 40. Performance Performance has been stellar. We still only run a few servers for each of our API clusters… after 4 years of growth! Go has never been our bottleneck, it’s always something else (ie: database).
  • 41. Memory No virtual machine - starts fast and small. IronMQ starts up in 6.5MB of resident memory including configuration, making connections, etc. Four years in, we’ve never had a memory leak or problems related to memory.
  • 42. Reliability Hard to quantify, but… Our Go applications are very robust. Rarely have a failure/crash that wasn’t related to some external problem. Code tends to be cleaner and higher quality. Strict compiler. Do a lot with a small amount of code.
  • 43. Deployment Go compiles into a single, static binary file. Deployment is simply putting that file on a server and starting it up. No dependencies required. No runtime required. Binary is small. (IronMQ is ~6MB)
  • 44. Rolling Back Since it’s a single binary, you just stop the process and start the previous binary. No need to worry about dependencies changing.
  • 45. Language and Tooling Keeps getting better and better. Better garbage collection. Better tools (for debugging, etc). More open source libraries.
  • 46. Talent When we first started, there were very few people that knew the language. We didn’t know if we’d be able to hire anybody! But people really want to work with Go. The caliber of talent that want to work for Iron.io is amazing.
  • 47. When I think about Go
  • 49. 6 Years Old 6 years and 6 days ago, the Go project was released. - Nov. 10, 2009 3.5 years ago, Go 1.0 was released. - March 28, 2012
  • 53. Production Usage 4 years ago, nobody was using it in production (except maybe Google… and us). Today, almost every startup I talk to is using it in some way or another. And a lot of the big guys are using it now too.
  • 54. Who’s Using Go Now? Thousands of engineers writing Go code. Millions of lines of Go source in the Google codebase. High-profile and/or open source projects: ● Kubernetes ● Vitess.io ● Google Data Saver ● The unannounced Vanadium project - https://v.io/ - source code here: https: //github.com/vanadium
  • 55. Who’s Using Go Now? Contributing to compilation and runtime for the Go language. Looking to expose more Intel platform features through Go libraries. Prototyping cloud ecosystem projects using Go. Hosting Golang training workshops for Women In Technology.
  • 56. Who’s Using Go Now? Replaced entire HTTP serving infrastructure with a Go stack. > 100B requests per day. ~ 1.15M queries per second.
  • 57. Who’s Using Go Now? Docker and all the Docker tools are written entirely in Go. Docker announced at GoSF:
  • 58. Who’s Using Go Now? #2 language (#1 being Ruby). Services using Go: ● Dashboard metrics ● System metrics ● Logging system ● ‘git push heroku master’: The ssh server behind this is written in Go. ● Postgres server monitoring “We're an infrastructure company and Go lends itself well to writing infrastructure code.” -- Edward Mueller
  • 60. Who’s Using Go Now? Server-side is 100% Go. Including real-time chat service. > 50M active users. 13 billion minutes/month.
  • 61. Conclusion We took a risk and it paid off. We love the language, and it’s loved us back. Usage is growing super fast. A lot of companies are already using it for critical parts of their production systems.
  • 62. Conclusion 2 years ago I wrote: “Is Go the next gen language we’ve been waiting for? It’s a bit too early to say, but it’s certainly off to a good start.“ Today: Yes it is. Go IS the language for the cloud. If you’re writing API’s or infrastructure, it should be at the top of your list. Is Go the new Java? It’s a bit too early to say, but it’s certainly off to a good start.