> Sometimes it works, like the following trace, and I get the accept(),
> sometimes I get "Connection closed by foreign host."
>
> Last one is the telnet
>
> epoll_wait(4, {{EPOLLIN, {u32=3, u64=3}}}, 1, -1) = 1
> accept4(3, {sa_family=AF_INET, sin_port=htons(34071),
> sin_addr=inet_addr("127.0.0.1")}, [16], SOCK_NONBLOCK) = 6
> read(6, "GET / HTTP/1.1\r\nUser-Agent: curl/7.32.0\r\nHost:
> localhost:9090\r\nAccept: */*\r\n\r\n", 4096) = 78
> select(0, NULL, NULL, NULL, {30, 0})    = 0 (Timeout)
> writev(6, [{"HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n", 44},
> {"Hello World (314)", 17}], 2) = 61
> close(6)                                = 0
> writev(2, [{"[pid: 29752|app: 0|req: 14/14] 127.0.0.1 () {24 vars in 247
> bytes} [Tue Aug 19 23:31:17 2014] GET / => generated 17 bytes in 30027
> msecs (HTTP/1.1 200) 1 headers in 44 bytes (1 switches on core 0)\n",
> 197}], 1) = 197
> epoll_wait(4, {{EPOLLIN, {u32=3, u64=3}}}, 1, -1) = 1
> accept4(3, {sa_family=AF_INET, sin_port=htons(34072),
> sin_addr=inet_addr("127.0.0.1")}, [16], SOCK_NONBLOCK) = 6
> read(6, "GET / HTTP/1.1\r\nUser-Agent: curl/7.32.0\r\nHost:
> localhost:9090\r\nAccept: */*\r\n\r\n", 4096) = 78
> select(0, NULL, NULL, NULL, {30, 0})    = 0 (Timeout)
> writev(6, [{"HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n", 44},
> {"Hello World (74)", 16}], 2) = 60
> close(6)                                = 0
> writev(2, [{"[pid: 29752|app: 0|req: 15/15] 127.0.0.1 () {24 vars in 247
> bytes} [Tue Aug 19 23:31:48 2014] GET / => generated 16 bytes in 30022
> msecs (HTTP/1.1 200) 1 headers in 44 bytes (1 switches on core 0)\n",
> 197}], 1) = 197
> epoll_wait(4, {{EPOLLIN, {u32=3, u64=3}}}, 1, -1) = 1
> accept4(3, {sa_family=AF_INET, sin_port=htons(34080),
> sin_addr=inet_addr("127.0.0.1")}, [16], SOCK_NONBLOCK) = 6
> read(6, "GET /test HTTP/1.1\r\n\r\n", 4096) = 22
> select(0, NULL, NULL, NULL, {30, 0})    = 0 (Timeout)
> writev(6, [{"HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n", 44},
> {"Hello World (79)", 16}], 2) = 60
> close(6)                                = 0
> writev(2, [{"[pid: 29752|app: 0|req: 16/16] 127.0.0.1 () {18 vars in 180
> bytes} [Tue Aug 19 23:32:18 2014] GET /test => generated 16 bytes in 30031
> msecs (HTTP/1.1 200) 1 headers in 44 bytes (1 switches on core 0)\n",
> 201}], 1) = 201
> epoll_wait(4,
>
>

It is the expected behaviour: the epoll_wait is never wake up as there are
no more free slots.

Maybe there is an important point you are missing: when you see accept()
in your process strace it means the previous requests has ended. There is
no other way for uWSGI to accept() in single process mode.


-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to