bullet-train-co / bullet_train

The Open Source Ruby on Rails SaaS Template
MIT License
1.58k stars 244 forks source link

Better & cheaper initial experience on Heroku #1525

Closed jagthedrummer closed 2 weeks ago

jagthedrummer commented 3 weeks ago

This PR does a few things to make the process of setting up an app on Heroku better and cheaper.

  1. It adds a buildpack for jemalloc and sets the JEMALLOC_ENABLED ENV var. This helps with memory usage. Fixes: https://github.com/bullet-train-co/bullet_train/issues/1524
  2. Makes the initial setup cheaper by using cheaper dynos and the entry level for a number of addons (in addition to removing the Bucketeer addon that seems questionably useful to begin with). This brings the monthly cost (as provisioned by app.json) down from ~$185/month to ~$22/month. Fixes: https://github.com/bullet-train-co/bullet_train/issues/1127
  3. Removes the Sentry addon. This was redundant since Honeybadger was already included, and Sentry isn't supported in review apps on Heroku, so having it in app.json prevents the use of review apps entirely which is frustrating. Fixes: https://github.com/bullet-train-co/bullet_train/issues/1521
  4. Sets RAILS_MAX_THREADS and WEB_CONCURRENCY to match the values suggested by heroku. Fixes: https://github.com/bullet-train-co/bullet_train/issues/1523

Joint PR for udpating docs: https://github.com/bullet-train-co/bullet_train-core/pull/850

jagthedrummer commented 3 weeks ago

We could potentially take another $7 off the monthly cost by defaulting to embedded Sidekiq instead of having a worker dyno.

kaspth commented 3 weeks ago

We could potentially take another $7 off the monthly cost by defaulting to embedded Sidekiq instead of having a worker dyno.

This definitely sounds interesting too! I don't know how embedded is to run though since I'm not much of an Ops person.