I have my setup hosted in AWS EC2, on am ubuntu machine, running a django server with uwsgi and apache. I've been trying to figure out for a while why the dev env VS local env have such different performance. With local server i return my index.html page in 80ms and in dev it takes almost 1s. I have django-debug-toolbar implemented and the CPU time is 300ms but chrome says the loading time is 1.3s (Waiting (TTFB)). Other big difference is that when i open then page with the URL it takes 1s but if I enter the server's IP it loads in 300ms.

I already tried everything and can't figure why the loading difference.

My apache virtual host:

 <VirtualHost *:80>
            <Location />
                    Options FollowSymLinks Indexes
                    SetHandler uwsgi-handler

uWsgi conf:

socket =
chdir = /home/ubuntu/production/<mysite>
processes = 4
threads = 2
venv = /home/ubuntu/production

  • try to figure out if DNS responses are slow.. URL slow, ip fast often are the result of a slow DNS resolve somewhere. – Dennis Nolte Dec 25 '16 at 16:49

For those who face a similar problem: I figured out that my problem was with cookies. I was keeping track of the browsing history inside my site as an array. Still didn't figure out the technical reason why it was slowing my request, but that was the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.