Skip to content

Instantly share code, notes, and snippets.

@agentzh
Created March 7, 2014 21:57
Show Gist options
  • Select an option

  • Save agentzh/9421063 to your computer and use it in GitHub Desktop.

Select an option

Save agentzh/9421063 to your computer and use it in GitHub Desktop.
strace output for os.date("...", ngx.time())
$ strace -p 22507 -s 1024
Process 22507 attached
write(4, "2014/03/07 13:52:43 [info] 22507#0: epoll_wait() failed (4: Interrupted system call)\n", 85) = 85
epoll_wait(3, {?} 0xd122b0, 512, -1) = 1
accept4(6, {sa_family=AF_INET, sin_port=htons(57726), sin_addr=inet_addr("127.0.0.1")}, [16], SOCK_NONBLOCK) = 7
epoll_ctl(3, EPOLL_CTL_ADD, 7, {...}) = 0
epoll_wait(3, {?} 0xd122b0, 512, 60000) = 1
recvfrom(7, "GET /t HTTP/1.1\r\nUser-Agent: curl/7.24.0 (x86_64-redhat-linux-gnu) libcurl/7.24.0 NSS/3.14.3.0 zlib/1.2.5 libidn/1.24 libssh2/1.4.1\r\nHost: localhost:8080\r\nAccept: */*\r\n\r\n", 1024, 0, NULL, NULL) = 170
write(4, "2014/03/07 13:52:45 [notice] 22507#0: *3 [lua] [string \"content_by_lua\"]:2: hi, client: 127.0.0.1, server: localhost, request: \"GET /t HTTP/1.1\", host: \"localhost:8080\"\n", 169) = 169
write(2, "today is Friday, in March (03/07/14)\n", 37) = 37
write(2, "today is Friday, in March (03/07/14)\n", 37) = 37
write(2, "today is Friday, in March (03/07/14)\n", 37) = 37
writev(7, [{"HTTP/1.1 200 OK\r\nServer: nginx/1.5.9\r\nDate: Fri, 07 Mar 2014 21:52:45 GMT\r\nContent-Type: text/plain\r\nTransfer-Encoding: chunked\r\nConnection: keep-alive\r\n\r\n", 155}, {"3\r\n", 3}, {"hi\n", 3}, {"\r\n", 2}, {"0\r\n\r\n", 5}], 5) = 168
write(5, "127.0.0.1 - - [07/Mar/2014:13:52:45 -0800] \"GET /t HTTP/1.1\" 200 13 \"-\" \"curl/7.24.0 (x86_64-redhat-linux-gnu) libcurl/7.24.0 NSS/3.14.3.0 zlib/1.2.5 libidn/1.24 libssh2/1.4.1\"\n", 177) = 177
setsockopt(7, SOL_TCP, TCP_NODELAY, [1], 4) = 0
recvfrom(7, "", 1024, 0, NULL, NULL) = 0
write(4, "2014/03/07 13:52:45 [info] 22507#0: *3 client 127.0.0.1 closed keepalive connection\n", 84) = 84
close(7) = 0
epoll_wait(3,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment