Friday, January 6, 2017

memory - Using nginx for WordPress alongside a Rails app

I have successfully configured nginx to serve a WordPress blog (at example.com/blog) alongside a Rails app. My stack is as follows:



Ubuntu 10.04, ngninx, unicorn (1 worker process for the Rails app), spawn-fcgi (for PHP and WordPress), and PostgreSQL.



My question is simple. How much memory should the above require? Currently I have 256mb, and it's completely dedicated to this app. My postgres process has already crashed once, so I'm afraid I need more. Is there a way for me to optimize this? Any thoughts?




I should mention that I'm a developer and completely new to server administration. This is my first attempt at deploying a Rails app to an unmanaged VPS.



EDIT: For what it's worth, here are some current statistics.




$ free -m
total used free shared buffers cached
Mem: 256 168 87 0 0 0




$ ps aux # => just the highlights
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
deployer 2014 0.0 6.4 21676 16880 ? Sl Apr29 0:00 unicorn master -D -c /home/deployer/apps/dailyshimmer_v
deployer 2017 0.0 29.6 86112 77856 ? Sl Apr29 0:12 unicorn worker[0] -D -c /home/deployer/apps/dailyshimme
postgres 5539 0.0 2.5 43304 6624 ? S 03:47 0:00 /usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgr
postgres 5541 0.0 0.8 43304 2116 ? Ss 03:47 0:05 postgres: writer process
postgres 5542 0.0 0.4 43304 1264 ? Ss 03:47 0:04 postgres: wal writer process
postgres 5543 0.0 0.9 44136 2372 ? Ss 03:47 0:01 postgres: autovacuum launcher process
postgres 5544 0.0 0.5 13900 1352 ? Ss 03:47 0:01 postgres: stats collector process

root 12074 0.0 0.4 8724 1096 ? Ss Apr29 0:00 nginx: master process /usr/sbin/nginx
www-data 12075 0.0 0.8 9224 2240 ? S Apr29 0:00 nginx: worker process
root 30334 0.3 8.3 43600 21812 ? Ss 00:52 1:08 /usr/bin/php-cgi

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...