Reputation: 23
I have deployed a service.
It is served by nginx, uwsgi, django, pgpool, postgresql stack.
The page that has no db access is no problem.
However, the page that has some data from postgres is tpo slow.
Actually, db query time is quite fast. under 10 ms.
But result to client is over the 120000 ms
uwsgi log
[pid: 2056|app: 0|req: 4/10] 211.207.245.120 () {44 vars in 1116 bytes} [Thu Jul 19 00:53:31 2012] GET /account/admin/cb_main/invitationuser/ => generated 38606 bytes in 122126 msecs (HTTP/1.1 200) 8 headers in 373 bytes (1 switches on core 0)
My settings are below
Please check my settings and solve my problems
nginx settings
upstream cuying {
ip_hash;
server 127.0.0.1:9001;
}
server {
listen 8080;
root /home/cuying_mgr/;
client_max_body_size 20M;
server_name cuying.com;
location / {
uwsgi_pass cuying;
include uwsgi_params;
uwsgi_read_timeout 120;
uwsgi_send_timeout 120;
}
}
uwsgi settings
chdir=/home/cuying_mgr/develop/virenv/cuying/cuying
processes=2
workers=8
enable-threads=true
socket=127.0.0.1:9001
module=cuyingProject.wsgi:application
master=True
pidfile=/tmp/cuying-master.pid
vacuum=True
close-on-exec=True
max-requests=3000
post-buffering=8192
socket-timeout=120
limit-post=20480000
virtualenv=/home/cuying_mgr/develop/virenv/cuying
daemonize=/var/log/uwsgi/cuying.log
Please help me out!
It's too slow.....
Upvotes: 0
Views: 2939
Reputation: 3008
Use profiler
to find out the slowest point while processing request. It looks like the problem was not caused by postgresql
or uwsgi
things.
See ProfilingDjango wiki page.
Upvotes: 0