Welcome to Working With Rails


Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
can't find bottleneck
6 Posts
can't find bottleneck

Hey Guys, this is going to be a long post because I'd like to get you all the information you need to answer the question. Earlier today I moved over to the standard linux nginx mongrel_cluster mysql stack however the mongrel cluster is on a different vm than nginx (nginx is acting as a reverse proxy). Previously nginx and the mongrel cluster were on the same vm, and everything was very snappy.

Now things are incredibly slow. What took under a second now takes 30 seconds to a minute. If I stop the browser and then hit refresh the page loads quickly. I suspect it is an nginx.conf problem?

The nginx box, mongrel box and db box are all 512MB vms and at 99% idle during this problem. 3 mongrels in the cluster. Static files are being pulled from the nginx box properly. So I have no idea why it is taking so long. I'll post the nginx.conf file and please let me know if I can offer any other information.

The site is www.dailymugshot.com

The conf file is: http://www.dailymugshot.com/nginx.txt (its a .conf in the conf dir)

The mongrel conf file in /etc/mongrel_cluster on the app vm is: user: mongrel group: mongrel cwd: /var/www/www.dailymugshot.com environment: production servers: 3 port: "8000" pid_file: log/mongrel.pid

If anyone has any ideas suggestions I'd really appreciate it!

Thank you,

-Keith Gould

Not positive, but I think I found the problems.

Firstly, in the static directory on the nginx server, I left the dispatch files by accident. I removed these so they were only in the public directory on the app server.

Secondly, the static directory on the nginx server was called 'static'. I changed this to 'public', to match the name of the public directory on the app server.

Honestly, I'm not sure at all if this is why the system works now. Still love any insight a guru might be able to offer.



The link to the nginx.txt fails.

thx Jeff, its up now.

The nginx file is very straightforward and although I've only set up a few nginx installations, I can't see anything wrong with this config.

If it is working now, you might just want to claim victory and march on.

Might help but I just posted a huge tutorial on setting up NGINX and the CONF files I've used to get mine tuned real good.

"beginning nginx":http://www.red91.com/articles/2008/02/06/beginning-nginx

Hope it helps, works for me.

6 Posts
Login to add your message