Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Our web app is running on a Linode 2048 server at the moment (~ 2048 GB of RAM)

The MYSQL database is on another linode of it's own so this server is really only handling NGINX and and the Rails application.

The application itself uses about 185976 of memory per instance (RSS).

Our traffic is < 1000 per day and the pages are mostly cached so there are fewer hits to the rails app itself.

My question is - how can I calculate optimal NGINX config settings for my app?

Below is the current config:

worker_processes  1;

# pid of nginx master process
pid /var/run/;

events {
  worker_connections  1024;

http {

  access_log /var/log/nginx/access.log;
  error_log /var/log/nginx/error.log;

  passenger_root /home/user/.rvm/gems/ree-1.8.7-2011.01@URTV/gems/passenger-3.0.3;
  passenger_ruby /home/user/.rvm/rubies/ree-1.8.7-2011.01/bin/ruby;

  include       mime.types;
  default_type  application/octet-stream;

  sendfile        on;

  tcp_nopush    on;
  tcp_nodelay   on;

  # gzip settings
  gzip  on;
  gzip_http_version 1.0;
  gzip_comp_level 2; 
  gzip_vary on;
  gzip_proxied any; 
  gzip_types text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

  # load extra modules from the vhosts directory
  include /opt/nginx/vhosts/*.conf;

Any advice would be appreciated! :)

share|improve this question

migrated from Jun 16 '11 at 18:18

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted

You can have a look a this blog post: which will explain how to calculate it

share|improve this answer
Thanks for the link – bodacious Jun 21 '11 at 21:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.