21

There are random times throughout the day that my app can have pretty extreme increases in load based on various factors.

At those times, I'd like to automatically increase the number of dynos.

I'd like to base the increase on the load time. So if it's taking X amount of time for pages to load, increase dynos. Otherwise, go back down.

Anything like that exist?

Shpigford
  • 24,748
  • 58
  • 163
  • 252

3 Answers3

18

HireFire is able to auto-scale both your web- and worker dynos based on various metrics. We currently support the following metric sources/types:

  • HireFire (Response Time) | Web Dynos
  • HireFire (Job Queue) | Worker Dynos
  • Heroku Logplex (Response Time) | Web Dynos
  • Heroku Logplex (Requests Per Minute) | Web Dynos
  • Heroku Logplex (Dyno CPU Load) | Web Dynos
  • NewRelic (Apdex) | Web Dynos
  • NewRelic (Response Time) | Web Dynos
  • NewRelic (Requests Per Minute) | Web Dynos

HireFire (Response Time) performs a basic HTTP request to measure response times.

HireFire (Job Queue) allows you to auto-scale your worker dynos based on their queue-sizes. You'll setup a very simple endpoint on your end (we have a RubyGem for this, but it can be done in any language with any library very easily). We'll periodically perform checkups and scale your worker dyno formation accordingly.

New Relic allows you to integrate with New Relic. It'll periodically fetch up-to-date metric data such as Average Response Time, Requests Per Minute and Apdex to determine your web dyno formation.

Heroku Logplex is our latest addition. This approach relies on your (and Heroku's) logs. Your logs will be streamed from Heroku's Logplex to HireFire's Logdrain, where it will be parsed for metric data. This allows you to auto-scale your web dynos in a more reliable way than with HireFire/ResponseTime as it grabs data directly from Heroku's Router. This approach doesn't require any external dependencies such as New Relic either.

Get in touch if you have any questions!

Michael van Rooijen
  • 6,683
  • 5
  • 37
  • 33
  • 1
    To clarify for future visitors, the [hirefire gem](https://github.com/meskyanichi/hirefire) is free and will scale your WORKER dynos as needed, if you want to scale your WEB dynos also, you have to use this paid app. I've been using the gem to scale workers for delayed emails and it's been 100% flawless from day 1. As soon as my traffic picks up to where I need multiple web dynos I'll be a paying customer. It easily saves more than it costs. – brittohalloran Jun 21 '12 at 16:23
  • Having trouble setting up logplex because the docs page is 404 :( http://docs.hirefire.io/docs/heroku-logplex where is the documents for this at? Thank you – Steve Peak Apr 15 '16 at 16:39
  • @StevePeak We've reorganized (moved) our knowledge base to better help customers find what they need before/while opening a ticket. See http://support.hirefire.io/help/kb/metric-sources/logplex -- Ironically that didn't help you. ;) – Michael van Rooijen May 21 '16 at 20:54
5

There is a new plug and play addon that just launched for this: https://addons.heroku.com/adept-scale

genkilabs
  • 2,966
  • 30
  • 36
  • I've been using Adept Scale on a number of apps and it's fantastic. – Shpigford Apr 25 '13 at 15:59
  • Unfortunately adept-scale only scales web dynos. Use hirefire.io to scale both web and worker dynos (even multiple worker queues independently). Works well for me. – djoll Oct 30 '13 at 12:09
0

Seems like heroku-autoscale is a good bet.

yfeldblum
  • 65,165
  • 12
  • 129
  • 169