Are there any major differences between the two? I have yet to see a doc that explains what the major difference is? Performance??
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are significant differences between “development” and “production” modes of operation even if the two seem superficially similar.
In development mode any file in
app/andconfig/routes.rbis reloaded with each request. This can take a considerable amount of time to process, but has the advantage of producing an up-to-date response based on any changes to your code-base, something that is presumably on-going in a development environment. Since the production environment should not change between deployments, Rails will cache your controllers, views, routes, helpers and models for maximum performance. Any changes to the source will require an application restart.Another feature of development is that the Rails logging level is set to
debugwhich is as verbose as possible. Not only do you get a detailed breakdown of every SQL call made, but you also get minor warnings and other informative messages that would otherwise be omitted in production. This logging is a considerable drag on performance and should not be used in a production environment unless you’re trying to diagnose a problem. These log files get very big very quickly and it can be difficult to rotate them without restarting your web server processes.There is also a method in the development environment to rescue from exceptions and render them as a human-readable error report. This is useful for debugging, but in a production environment may expose sensitive details about your application as it often includes a lot of information about the filesystem, key parameters, and so on. This should never be enabled on a production site.
These differences may not be obvious, but you simply need to compare the configuration settings in
config/environments/development.rbandconfig/environments/production.rb. Unfortunately it is not obvious what some of the defaults are, as they are not expressed clearly in these files sometimes, but the basics are usually there.