I am analyzing what is the thinnest configuration on an Ubuntu server to run my Rails 3.2.6 application with a minimum memory size with Nginx + Unicorn configuration. And using the local postgres database.
After removing many services, such as whoopsie and apparmor, in ubuntu, and even if only the most basic processes, I can create an instance of my workers on both sides, nginx and unicorn, for a total of 500 MB.
. .
:
$ free -mt
total used free shared buffers cached
Mem: 3001 550 2450 0 16 178
-/+ buffers/cache: 355 2646
Swap: 952 0 952
Total: 3954 550 3403
$ ps -ef | grep nginx
root 1232 1 0 12:54 ? 00:00:00 nginx: master process /usr/sbin/nginx
www-data 1233 1232 0 12:54 ? 00:00:00 nginx: worker process
www-data 1234 1232 0 12:54 ? 00:00:00 nginx: worker process
www-data 1235 1232 0 12:54 ? 00:00:00 nginx: worker process
www-data 1236 1232 0 12:54 ? 00:00:00 nginx: worker process
herminio 5292 1078 0 13:24 pts/1 00:00:00 grep nginx
$ ps -ef | grep unicorn
herminio 4863 1 0 13:01 ? 00:00:00 unicorn_rails master -c unicorn.rb -D -E production
herminio 4866 4863 2 13:01 ? 00:00:34 unicorn_rails worker[0] -c unicorn.rb -D -E production
herminio 5296 1078 0 13:24 pts/1 00:00:00 grep unicorn
$ ps -ef | grep postg
postgres 935 1 0 12:54 ? 00:00:00 /usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main -c config_file=/etc/postgresql/9.1/main/postgresql.conf
postgres 940 935 0 12:54 ? 00:00:00 postgres: writer process
postgres 941 935 0 12:54 ? 00:00:00 postgres: wal writer process
postgres 942 935 0 12:54 ? 00:00:00 postgres: autovacuum launcher process
postgres 943 935 0 12:54 ? 00:00:00 postgres: stats collector process
postgres 5215 935 0 13:12 ? 00:00:00 postgres: user_db pto_db_prod 127.0.0.1(47118) idle
herminio 5300 1078 0 13:24 pts/1 00:00:00 grep postg
, 92 1 , Nginx Unicorn, +1, .
, .
, 3 .
-, rails.
, , :
bundle install --without development test # , Gems, .
, ActiveRecord, , .