issues with Nginx + Passenger Production setup - Loading time/request time delay

Posted on 2012-09-18
Last Modified: 2012-09-19
having a bit of an issue relating to request time. I have NGINX as a proxy server for a ruby on rails app running passenger. I also have a postgresql database server which is running on its own VM separate from my nginx/application server. My issue is that when I try and access my products page which does a lot of database queries, my query takes maybe 3-4 seconds. The second I flood the web server with requests, i will choke out the web server and have requests take almost 20-30 seconds to process. The rails server and database server do not crash, and the usage is not that high. Each server has more than enough memory, even cpu usage on the rails server isn't more than 85%, albeit thats high but its not maxing it out.

Is my problem related to my nginx proxy server?

I dont really know how to fully explain this so if you have a question please ask it and I can clarify what I mean.

EDIT: to see exactly what i mean relating to the database query, see
Question by:itmanager223
    LVL 26

    Expert Comment

    How big is your connection pool?

    Author Comment

    right now it is 16
    LVL 26

    Accepted Solution

    So that will permit 16 simultaneous connections from the App server to the DB.

    How many concurrent users / threads where you simulating in your test, and how long between requests, from each thread did you use?

    If the number > 16 and 4 sect then the requests will queue.

    Author Comment

    so my programmer ended up finding the issue using new relic. Turned out to be a few misbehaving lines of code relating to database queries.

    Thanks a lot for your help arober11.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Article by: kevp75
    Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
    Recently I spent hours debugging an issue in a Rails project where ActiveRecord was causing MySQL errors trying to create a User object of a class at the top level of a Single Table Inheritance model structure.  It turns out `.create` behaves differ…
    Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now