Is it possible to set a spending limit on Heroku? - heroku

I have a Rails app deployed to Heroku on the Cedar Stack. I'd like to start running a nightly scheduled task, but in order to add the scheduler add-on, I need to give Heroku my credit card details.
I'm not sure how much this will end up costing, though, so I'd like to be able to set a spending limit on my Heroku account.
In other words, I'd like to be able to say "Please don't let me use dyno hours that will cost me more than $XXX per month".
Any ideas? Thanks!

I asked this same question on the Heroku forums. The answer is no, there is currently no way of setting a spending limit.
It is a feature they are considering implementing, though.

No, it's currently not possible to manage your cost natively with Heroku because they don't offer such feature at the moment.
However, there are a few third party solutions available. For example, the Heroku add-on cloudvertical claims to be able to track and analyse cloud infrastructure usage and costs.
There is also HireFire, a dyno manager.
If you search for Heroku scaling, or Heroku autoscaling, you will find a few solutions.
Disclaimer: I haven't tried them.

Related

Heroku alternative

I´m new on development and found Heroku easy for deploying my app.
I was happy until I got to problems:
Heroku does not provide an IP adress which I need for a white IP list to access an API. I fixed this with a Heroku add-on proxy called Fixie. That is free if under 500 request per month.
The Heroku free plan sleeps after 30 min of inactivity. My app needs to makes API requests at midnight and this is getting difficult because the app is sleeping.
I was thinking to pay the nearest cheap plan on Heroku which make that the app does not sleep. But then I though why not use another platfrom than Heroku.
Does anyone have some sugestions? Any other platform that give an IP so I don´t worry about crossing the 500 request per month?
I was thinking of AWS Elastic Beanstalk. But as I said I´m new at this.
You can use DigitalOcean: the cheapest plan is 5$ a month and you get a Droplet with its own IP address. The Droplet is always running (no inactivity timeout like Heroku).
The main difference is Heroku provides an abstraction layer on top of the underlying infrastructure (you only deal with the application deployment and management) while DigitalOcean delivers a virtual box (ie Ubuntu), however the documentation is great and you can easily find what you need (ie install Docker, etc..)
Couldn’t agree more.
I have been running many applications on Heroku for years now and have faced the 1st problem that you’ve mentioned multiple times.
I tried using Engine Yard instead of Heroku as far as I can remember I never faced the IP issue that you are referring to. AWS is good, but again it’s not without its limitations because its really hard to use. It’s these shortcomings that drive users crazy, isn't it? All I can say is that when I shifted to Engine Yard the set problems I faced considerably dropped. It appears to be a much more usable platform. Check it out.
Here’s a link to Engine Yard, which I hope will help you.

Heroku pricing dramatically increases when using microservices architecture

I'm just starting with Heroku, and I'm considering using it to host my app.
The problem is, I'm planning to build my app with a micro services architecture.
As I understand Heroku's pricing, they charge per dyno. When using micro services, there are a bunch of "apps" or "services" working together to provide the functionality of one app.
It seems inevitable to do this without using multiple dynos, and by adding dynos, the price goes up very quickly.
I have three questions:
Is my interpretation of Heroku's pricing correct?
Is there a better way to do a micro services architecture using Heroku?
Or, is there a way to deploy multiple docker containers on a single dyno?
Your Heroku costs will definitely go up as you use more dynos and more apps, but if you are just starting out, the money you spend will be in no way more than the time you would spend setting up something like AWS to perform the same functionality.
You can always save money later, once your app is running and users are loving it. If you goal is to prototype and get it out fast, Heroku is still the best choice.
Did you know about Heroku price calculator?
Saw you run 10*1x dynos, plus some other services, like text messages and such. That will cost you $250-350 this month. That's a lot, sure. But you can get your app running tomorrow, and presumably that is worth a lot more than 250.

Heroku platform credits

I just verfied my Heroku account and now Heroku tells me that I have 161$ Platform credits. Does that mean that I have to pay 161$?
I wouldnt know how I possible could accumulated such a bill in such a short time...
Best
It means you have got 161$ to spend (only on Hobby Dynos, in case you're a student).
See the official Heroku post here

Adding the billing card to the Heroku account and cons/pros of using dynos

Since I am not very familiar with Heroku I need opinion of a specialists like you. I got two questions to which I cannot find an answers on the web.
Heroku tempts with the 450 dynos if I add the billing card.
Is that secure to add it?
Will they take the money from my account without my permission? If for instance I have used all the dynos, would they take the money from my account to add some dynos?
Do dynos last for long? How many users can use my site if I got 1000 dynos?
I tried to understand the answers from the another questions here in stack, but I could not understand them.
Please do not use the technical language, try to answer these questions as simply as you can (for me and users who will read it).
This is a very vague question, so I'll do my best to answer it clearly.
Adding your credit card to Heroku is perfectly safe. They are a legitimate company.
Heroku will automatically charge your credit card at the end of the month if you go OVER their free tier, meaning you use more than 450 dyno hours across your Heroku account, or if you provision paid addon services.
Dynos last forever, until you remove them. Heroku allows you to add dynos, remove them, etc., all instantly.
You also asked how many users your site can support if you have 1,000 dynos: this is equivalent to asking how many users your site can support if you have 1000 web servers. This is dependent on many factors: what does your site do? How was your site built? Etc.. In general, most webapps on Heroku only require 1 dyno to run indefinitely.

Scaling a Meteor app on Heroku

In an answer to another question, it's noted that "Apps deployed to the hosted servers with 'meteor deploy' do not yet have any guarantees or SLAs about scaling." So that rules out the possibility of using their hosted servers if I want to be sure I can fully scale, now.
The answer further notes that "A server bundle generated with 'meteor bundle' is basically a single process app. It is up to you wire it up to multiple instances, or however you want to implement auto-scaling."
After reading that, I'm still very unclear on the question of scaling. On Heroku, I assume I can run "meteor bundle" single process apps in dynos. But if I use many dynos, each running a Meteor server bundle, is Meteor designed so that they can be wired up so that they are all synchronized with the same data (even if there's a lag)?
Answering my own question, the Meteor team has announced a roadmap which includes the scalability plans, for inclusion in Meteor 1.0.
Meteor is still very young platform. Before scalability,personally i would put question of security, as Meteor right now is having no security model in public release. Also no mention of security in Meteor docs, but Meteor team has confirmed that they are working on it, and future release will have it. Have a look here: https://stackoverflow.com/questions/10100813/when-can-we-expect-data-validation-and-security-in-meteor
So I think you and I (for security implementation) have to wait for more releases and perhaps before 1.0 scalability will be handled internally, or atlease they should have documentation explaining how to do that.
To get some idea about, how scalability will be handled and to get better picture on it, I think someone from meteor team should answer about scalability.
You can deploy meteor apps into Heroku but you need to stick with 1 dyno. Because Heroku does not support WebSockets or Sticky Sessions.
So you need to find another PAAS provider. Nodejitsu is a good option.If you wan't to scale into multiple instances, you need to find a way to sync write operations between instances.
Then You'll need Meteor Cluster - http://goo.gl/2aHJ2
I recently asked a similar question (Which PaaS would be best for a Meteor JS app that needs to be scalable?), and one of the answers explained the Heroku situation very well (I thought) - see https://stackoverflow.com/a/16468418/2311632 . It is also pointed out (https://stackoverflow.com/a/16468609/2311632) that one could deploy on meteor.com. While scaling is still on the roadmap, presumably they have or are addressing some scaling issues 'in-house', or can otherwise keep their service at the cutting edge of what's possible in scaling for Meteor Apps. Otherwise, you could go with EC2 and scale vertically (boost the power of a single instance) until Meteor hits the mark with official scaling solutions. Getting set up with EC2 is new to me, but this answer (https://stackoverflow.com/a/16468826/2311632) looks like a good starting point. I haven't tried it yet, but likely will soon.

Resources