-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Using the following simple code:

import uwsgi

def KV55(environ, start_response):
    response = environ['wsgi.input'].read(int(environ['CONTENT_LENGTH']))
    start_response('200 OK', [('Content-Type', 'text/xml'),
('Content-length', str(len(response)))])
    yield response

uwsgi.applications = {'':KV55}


I am getting a one second penalty timeout because I am reading the
wsgi.input.

To test this I am using:

uwsgi --http 127.0.0.1:8181 -w simple
curl -X POST -T kv55.xml http://127.0.0.1:8181

uwsgi gives me:

[pid: 6625|app: 0|req: 1/1] 127.0.0.1 () {30 vars in 400 bytes} [Tue
Jan 24 02:46:41 2012] POST /kv55.xml => generated 3935 bytes in 1001
msecs (HTTP/1.1 200) 2 headers in 65 bytes (1 switches on core 0)



When simple not touching the wsgi.input at all:

[pid: 6702|app: 0|req: 1/1] 127.0.0.1 () {30 vars in 400 bytes} [Tue
Jan 24 02:49:53 2012] POST /kv55.xml => generated 0 bytes in 0 msecs
(HTTP/1.1 200) 2 headers in 62 bytes (1 switches on core 0)


When I am specifing --post-buffering 1 the situation gets worse even
when the wsgi.input is not touched at all.


Obviously I know how to debug; strace shows me:

writev(8, [{"\0\220\1\0", 4}, {"\16\0", 2}, {"REQUEST_METHOD", 14},
{"\4\0", 2}, {"POST", 4}, {"\v\0", 2}, {"REQUEST_URI", 11}, {"\t\0",
2}, {"/kv55.xml", 9}, {"\t\0", 2}, {"PATH_INFO", 9}, {"\t\0", 2},
{"/kv55.xml", 9}, {"\f\0", 2}, {"QUERY_STRING", 12}, {"\0\0", 2}, {"",
0}, {"\17\0", 2}, {"SERVER_PROTOCOL", 15}, {"\10\0", 2}, {"HTTP/1.1",
8}, {"\v\0", 2}, {"SCRIPT_NAME", 11}, {"\0\0", 2}, {"", 0}, {"\v\0",
2}, {"SERVER_NAME", 11}, {"\7\0", 2}, {"nemesis", 7}, {"\v\0", 2},
{"SERVER_PORT", 11}, {"\4\0", 2}, ...], 65) = 404
epoll_ctl(6, EPOLL_CTL_MOD, 8, {EPOLLIN, {u32=8, u64=8}}) = 0
epoll_wait(6, {{EPOLLIN, {u32=7, u64=7}}}, 64, 30000) = 1
recvfrom(7, "<?xml version=\"1.0\"?>\n\n<DRIS_55>"..., 65536, 0, NULL,
NULL) = 3935

The epoll_wait is actually where the time is spent.


Could anyone help me out, getting a better response time?


Stefan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEAREKAAYFAk8eEDQACgkQYH1+F2Rqwn1FMQCfRwEc3aCPDGFqKBoBz4NtU3HX
DgIAn3ZH7UUZsSp6VKaeGIW9UqWquy/d
=HZ1t
-----END PGP SIGNATURE-----
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to