Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Sunday, 30 October 2011

installing sunport_rails on ubuntu production

We've added search functionality to Toygaroo with Solr via sunspot_rails.

If you are going to install it on Ubuntu then make sure you do:

sudo apt-get install openjdk-6-jdk

First!

Monday, 2 May 2011

nginx, rails and ubuntu - 502 bad gateway

We were getting tons of 502 errors under load, but then I stumbled across a posting in a news group.

cat /proc/sys/net/core/somaxconn


Will show you how many connections you can have. This should be 1024, because Phusion Passenger is hard coded for this value. Mine was 128!

Do this:
sudo sysctl -w net.core.somaxconn=1024


And then restart nginx.

Tuesday, 6 October 2009

rotating nginx logs

Since moving most of my systems over to plain Ubuntu on EC2 (as opposed to using ec2OnRails) I've needed to figure out certain things - like rotating the nginx logs (using Nginx instead of apache).

Simply create a file in /etc/logrotate.d/nginx that looks like this

/opt/nginx/logs/*.log {
daily
missingok
rotate 30
compress
delaycompress
sharedscripts
postrotate
/etc/init.d/nginx restart
endscript
}

Friday, 24 July 2009

move from ec2onrails

Recently the performance on FilmAmora.com has been plummeting. And I had no idea why. Often apache was timing out waiting for a mongrel. Very little development has happened recently on FilmAmora, so I was stumped.
So - like a good developer - I took this as a chance to make a drastic move from ec2onrails machines to straight ubuntu, with everything else installed by hand.

It has made a HUGE difference. So much so that I could actually drop a machine from the configuration and still have better response times.

I followed these instructions to get started: rails-nginx-passenger-ubuntu. I also switched to nginx and ruby enterprise edition - just to make following the instructions easier.

So far so good. It took a couple hours and presto a leaner meaner installation. My NewRelic Apdex score went from .5 to .9.