As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I wanted to know which is the best web server to use with heroku running ruby 2.0.
I'm currently running puma but cannot take full advantage of it without rubinius or jruby. I don't want to change my interpreter from ruby 2.0 native.
My goal is to have a web server that scales efficiently as I scale up my heroku dynos.. Thus, helping me serve as many concurrent users as possible.
The first part of the decision is if your application is considered thread safe.
Out of the box Rails < 4.0 is not! If you want it to work on multiple requests at the same time, you need a server that is capable of forking. Most prominent example: Unicorn. Heroku suggests that for Rails apps.
However, if your app is not limiting itself to one thread:
I suggest to use puma. It does support multiple threads on a single dyno. Even with MRI.
As said on pumas official website it uses significantly less memory than unicorn.
I honestly don't know what you mean by "cannot take full advantage". The only problem you might run into is, independent of the platform it runs on, that your application is thread safe.
My goal is to have a web server that scales efficiently as I scale up my heroku dynos.. Thus, helping me serve as many concurrent users as possible.
Once you spin up multiple dynos, the webservers will be started on each dyno independent of each other. I don't see any special needs for this scenario.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I'm working on a Ruby on Rails project that acquires and displays information on how undervalued stock mutual funds and ETFs are (by price/book ratio, price/cash flow ratio, etc.). My source code is at https://github.com/jhsu802701/bargainstockfunds-scrape .
At the moment, my focus is mainly on the Ruby side. I am new to the world of Ruby on Rails development, and I'm heeding the advice to learn Ruby first.
I need to use a database to store data acquired by my Ruby script. I know that there are several options (MySQL, NoSQL, PostGres, etc.), but I have no prior experience with databases. What do you recommend using and why? (Best support? Best performance? Easier to work with? Other reasons?)
SQLite is very convenient during development in Rails. It is small, file-based, and portable.
As a bit of a "perfectionist" I tend to spend a whole lot of time in development, on my local machine.
I, too, have far more experience with MySQL and use it for my production database on Rails projects. Remember that you can configure a different db for each Rails environment ("development", "production", "test").
Rails migrations make it really easy to build up a new database once you switch from development to production.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I used to use the Webrick server for Ruby on Rails, but now my boss asked me to run the ROR code on apache server, I see there are some difference between these two servers, and I don't know how to access the controller/action on apache, so anyone happens to know any book about ROR on apahce? Thx!
To run directly in Apache, your best bet is to use Phusion Passenger, which can act as an Apache module.
However, I think you're missing a bit of conceptual information as well. Here's some of the common Rack servers used to host rails:
WEBrick: A web server implemented purely in Ruby (that ships with Ruby). It is not very performant, and is relatively limited. It makes for a great development webserver, but most people don't use it in production.
Thin: A very performant evented web server that is particularly easy to get up and running.
Unicorn: A forking web server that is widely used and recommended (written by GitHub) - but requires a bit more management to get up and running in production.
In nearly all cases, however, people generally have Nginx or Apache in front of their Rails webserver of choice (as a proxy):
Nginx/Apache do a much better job of serving static files than any of the options above. If you are not using a CDN to host your assets, you should definitely configure the proxy to host them.
Nginx/Apache are great at managing large volumes of requests and queueing them so that your app server can focus on in-flight requests rather than a deluge of queued-up requests.
Less surface area for security vulnerabilities.
My configuration of choice is Nginx+Unicorn; I find Apache too unwieldy to administrate, and Unicorn is particularly great.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have small rails application with mysql2 database (2 tables), backbone and bootstrap. I think, that that amount of visits will be max 50ppl per week, so I want to find cheap (~10 $/m or cheŠ°per) hosting for it. I found dreamhost, is it good or not? What else you can suggest to me?
I usually run all my small rails apps off heroku.com if your app is under 100meg(images you put on amazon s3 wich is also free if you use the free tier). Heroku has very easy deployment aswell :D Hope this helps.
here is a how to for heroku
https://devcenter.heroku.com/articles/rails3
here is how to for amazon s3 (to store your images or whatever you like to store there)
http://doganberktas.com/2010/09/14/amazon-s3-and-paperclip-rails-3/
Alternatives to heroku
EngineYard - http://www.engineyard.com/products/cloud
Openshift - https://openshift.redhat.com/app/
Amazon - Tutorial On Deploying Rails Apps to the Amazon Cloud?
http://www.heroku.com/ - 0$/m for small projects.
I have two projects on heroku for more then one year. Not one of them has not yet become a hightloaded. And I paid 0$ for all time.
I've used Linode (linode.com) for many years with hardly any problems. Their cheapest plans do start at $19.9 though.
Check out Heroku and Amazon Web Services.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I was wondering what people think is currently the best host for Ruby on Rails. I found some older posts on here on the subject but I wanted to know what the current agreement is. Shared hosting is ok for now but I would like an option from dedicated hosting later.
Thanks!
Even though some will complain, Heroku is still the best in my mind. Super easy to set up, super easy to scale. You can deploy to Heroku in all of 2 minutes. Best of all, it's free with basic usage.
Another thing I like about Heroku is that it has an unparalleled community using it, which means a lot of support on StackOverflow (https://stackoverflow.com/questions/tagged/heroku).
If you need to know what ratio of web/worker dynos you'd need, look here:
Heroku: web dyno vs. worker dyno? How many/what ratio do I need?
Although keep this in mind: it will be a while until you need to scale. As 37signals says, deal with scaling when you have that problem.
If you're looking for more flexibility, Amazon EC2 is always a good option. You pay only for what you use, which is always nice.
Linode is still decent, and fairly cheap too.
I think the best choice is AWS or Heroku
It all depends on what you are building and how you are building it. If you app is pretty straight forward rails app and you are not doing anything special on the system level (lets say working with transcribing video in a way that heroku add-ons would support it) than heroku is probably one of the fastest way to get started an move along. If you are are building something on the system level where you app needs to have access to anything on the system you probably better off going with linode or AWS route, It also depends alot about the level of control/responsibility your are looking for.
THere is also survey being done right now about this very topic, they havent published the 2012 results but 2009 are available:
http://rails-hosting.com/Results/SurveySummary.html
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am trying to persuade my boss about using Grails.
I tell him it is the most productive way to implement our shopping web site.
But he has doubts about its scalability when traffic gets higher and higher.
So can you give examples of enterprise level web sites with
notable traffic implemented in grails.
Also is there anything that I have to take into account when building
such an enterprise level web site that will probably have high
traffic.
Note: We may expect 10K daily hit.
Take a look at the Grails Success Stories. The most popular sites may be: Sky.com and mp3.walmart.com
Groovymag has some good information on this but costs $5 per issue. This issue has both an interview with a guy from Sky which is a very large site that uses grails as well as information in implementing an e-commerce site using Grails. The main point I got from reading the interview from one of the sky.com developers is that they have no problem scaling to millions of page views by smart use of caching. Although your site may have 10000 views a day most of those views should not need to access the database. You can cache information on each product available in order to limit the number of queries necessary when viewing the site. This should reduce the traffic on your database and make GORM less of a possible bottleneck. I have not been able to find out how GORM performs under heavy load, but if worse comes to worse you could write your performance critical database code using pure JDBC calls and put it in a service.
If you do the math, 10K daily hits is less than one hit per second- even if all 10K hits happened during a 3 hour "peak traffic" window. Even assuming you meant "page renders" and not hits, you are talking about a really miniscule amount of traffic.