开发者

Hosting questions for a "high" traffic rails application

开发者 https://www.devze.com 2023-04-12 09:17 出处:网络
I\'ve got a question concerning hosting for a high traffic rails application. The thing is i have 3 / 4 years experience with Ruby on Rails applications but i never had a high traffic website before.

I've got a question concerning hosting for a high traffic rails application. The thing is i have 3 / 4 years experience with Ruby on Rails applications but i never had a high traffic website before. I'm really excited because this is the "next level" for me and my co-worker. The thing is we don't have experience with a rails application to handle "high traffic", first of all let me define "high traffic" in this case.

We are developing a rails application for one of the leading dutch telecom providers and the approx. visitors per day will be around 400.000 users. We are programming in ruby 1.9.2 and Rails 3.1. We are using devise for authentication handling. But we are looking for a reliable party to host this application. We are looking at Heroku but i don't have a cl开发者_如何学运维ue what i need and how much workers, dyno's and/or dedicated database i need. We need to stream movies, and we are planning to host them on a amazon s3 bucket.

So the thing is i'm looking for advice concerning Heroku and/or other professional and reliable parties. Are there things i need to take in consideration concerning the rails application?

Thanks!


It's quite easy to roughly work it out in terms of dynos.

A dyno is single threaded so if your page takes 200ms to render you can render 5 pages per second. You need to figure out how many pages per second those 400,000 users will make. Then you know how many pages per second are being requested and what a single dyno can handle. So you'd simply increase you dyno count until you meet your user requests per second figure.

eg 1 dyno @ 200ms = 5 pages per second 2 dynos @ 200ms = 10 pages per second

etc etc. It's only a ball park figure as there are going to be other factors like DB performance etc but rest assured Heroku is suited for this type of scenario since it's just so easy so add more dynos to increase through put.

You will need to use workers for any long running event, eg sending email etc where there's a third party that may take time to respond and handling queues if your application uses them.

Once you go over 20Gb database then you need to be using a dedicated database and it sounds like from the client that the $200 per month starter DB isn't going to make them sweat in tersm of hosting costs.

Did i miss anything? If i did get back to me,

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号