Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 788 Vote(s) - 3.46 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How many Rails apps on 1 Heroku dyno?

#1
I just can't find how many apps you can host on heroku with one dyno?

I plan to host a lot of small apps with little traffic.

Thanks for your answers
Reply

#2
I believe you can spin up another web process inside a web dyno. I've done it with workers. One worker dyno had 3 sub-processes. each a copy of the rails app, and each running independently on the database.
How you'd manage to spin up the correct application, I'm not sure... And you'd need a controller application.
I don't want to say it's not possible, because I don't believe that statement is at all constructive. I will say, spawning a new application with a 34$ a month extra dyno fee would be a better use of you time/money.

An additional concern. each web dyno allows for a limited amount of memory, and rails isn't exactly known for being light on memory. When I spawned sub-workers I ran into heaps of memory issues. So many that I eventually rolled the feature out. If I work for an afternoon to try to 'tweak' for the constrains, I've spent more of my bosses money than 4 months of extra dyno's, so I have to weigh it up.

Anyway... Here's how I forked workers

require 'heroku-api'

...

def self.fork_workers(iDesired = 5, iQueue = nil)
cmd = "rake jobs:work WORKER=MY_SERF"
cmd += " QUEUES=#{iQueue}" if(iQueue)
p cmd
if(RUBY_PLATFORM["mingw32"].nil?) #DON'T WORK ON WINDOWS
currentCount = Rush::Box.new.processes.filter(:cmdline => /#{cmd}/ ).size;
iDesired -= currentCount;
if(iDesired > 0)
iDesired.times { Rush::Box.new[Rails.root].bash( cmd, :background => true ) }
elsif(iDesired < 0)

end
end
end

Last note:
One dyno apps will go to sleep if left alone for an hour... Your users will feel the delay during wake up.

[To see links please register here]

Reply

#3
Some explanation here: [

[To see links please register here]

][1]


[1]:

[To see links please register here]

Reply

#4
Dynos are calculated on a per application basis.

However, this doesn't mean you need to buy 3 dynos to run 3 apps.
You can create 3 application each with 1 dyno.
Reply

#5
One App per Dyno / subdomain.heroku.com.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through