Upload
vincent-spehner
View
123
Download
0
Embed Size (px)
DESCRIPTION
Heroku mades App scaling a breeze. Learn during that session the theory basis of applications scaling and understand how this is made possible on Heroku. Discover best practices to make your application even more performant and more scalable.
Citation preview
Creating Scalable Customer facing apps on HerokuVincent Spehner, Heroku Practice Manager, @vzmind
Slideshare: http://www.slideshare.net/VincentSpehner
“I cannot teach anybody anything. I can only make them think” Socrates
From theory to action
Understanding scalability
Why is Heroku Scalable?
First Make your app scalable
Horizontal scaling
Vertical scaling
Scaling Strategy
Automated scaling
Understanding scalability
Vertical vs Horizontal Scale up (vertical)
Scale out (horizontal)
New Relic
Librato
Understanding scalability
Monitor your key metrics:
Throughput: Number of request per second
Latency: Time to respond to a request (ms)
70% utilization per dyno
Why is Heroku scalable?
The 12 factors have defined Heroku architecture.
Process (stateless and share nothing)– data must be persisted
– session are stored in shared Mem.
Assets should be externalized
Logs (stream of aggregated info)
12factor.net
Why is Heroku scalable?
Understanding the slug– Compiled version of your current
code (Stack, dependencies, assets … )
Scaling up and down with CLI
Current Slug
New Dyno New Dyno
Enough theory, let’s SCALE !
“Dont try to scale a bloated or memory leaking app, it won’t save kitties” - Me
First, make your app scalable
Request queuing (understand your framework)
Use Unicorn, Gunicorn, Node.js multiple threads/process per Dyno
improve concurrency per dyno.
First, make your app scalable
DB indexes
DB Connections :– Make sure you dont overload the DB Plan,
– limit your connection with a reasonable buffer (Bad connections)
First, make your app scalable
API Caching
Group SFDC Calls with Custom Apex End Points
Don’t use Cache or API, use Heroku Connect
Externalize Assets, Use CDN
Stay close to your customers (regions)
Horizontal scaling
Expanding your number of concurrent Dynos/Workers
Heroku ps:scale web=5
heroku ps:scale worker=2
heroku ps:scale api=3
Decoupled applicationsAPI
FrontEnd
EmailerScheduler
Read: https://blog.heroku.com/archives/2013/12/3/end_monolithic_app
Vertical scaling
Available options:
Scaling Strategy
Scale out, then up, then out again
Auto-scaling
Define the metric
Define the response
Use Heroku API
Potential approaches:– Checking number of queued jobs and scale worker
– Check memory/load usage with Log stream, log-runtime-metrics
– Check page response time with Pingdom
https://github.com/Swop/heroku-autoscale
Auto-scaling solutions
https://addons.heroku.com/adept-scale
https://manager.hirefire.io
Heroku Connect
Why mentioning Heroku Connect ?
Remove lot of the burden of dealing with an API
Reduce latency of API calls
Optimize the API calls (Bulk, REST)
Bi-directional synch
To summarize:
Define your performance metricsScale your app first Use Heroku to easily scale
Thank you !
Slideshare: http://www.slideshare.net/VincentSpehner