$host = '127.0.0.1';$port = 8888;$key = 'group:32149904:binding';$redis = new Redis();$redis->pconnect($host, $port);$obj = $redis->get($key);echo $obj, PHP_EOL;
PHP code is the above, and then I strace a bit, the result is as follows
1565 Connect (3, {sa_family=af_inet, sin_port=htons (6080), sin_addr=inet_addr ("10.83.73.168")}, +) = 1 einprogress ( Operation now in progress) 1566 poll ([{fd=3, events=pollin| Pollout| pollerr| Pollhup}], 1, +) = 1 ([{fd=3, revents=pollout}]) 1567 getsockopt (3, Sol_socket, So_error, [0], [4]) = 01568 fcntl (3, f_s ETFL, O_RDWR) = 01569 setsockopt (3, Sol_tcp, Tcp_nodelay, [1], 4) = 01570 poll ([{fd=3, events=pollin| pollpri| pollerr| Pollhup}], 1, 0) = 0 (Timeout) 1571 sendto (3, "*2\r\n$3\r\nget\r\n$22\r\ngroup:32149904" ..., 0) = 4 21572 poll ([{fd=3, events=pollin| pollpri| pollerr| Pollhup}], 1, 0) = 0 (Timeout) 1573 poll ([{fd=3, events=pollin| pollerr| Pollhup}], 1, +) = 1 ([{fd=3, Revents=pollin}]) 1574 recvfrom (3, "$44\r\n{\" allyid\ ": \" 60979\ ", \" appid\ ": \" "..., 8192 , msg_dontwait, NULL, NULL) = 511575 Write (1, "{\" "allyid\": \ "60979\", \ "appid\": \ "ex_mm" ..., () = 441576 write (1, "\ n", 1) = 11577 Poll ([{fd=3, events=pollin| pollpri| pollerr|Pollhup}], 1, 0) = 0 (Timeout) 1578 setsockopt (3, Sol_tcp, Tcp_nodelay, [1], 4) = 01579 poll ([{fd=3, events=pollin| pollpri| pollerr| Pollhup}], 1, 0) = 0 (Timeout) 1580 SendTo (3, "*2\r\n$3\r\nget\r\n$22\r\ngroup:32149904" ..., 0) = 4 21581 poll ([{fd=3, events=pollin| pollpri| pollerr| Pollhup}], 1, 0) = 0 (Timeout) 1582 poll ([{fd=3, events=pollin| pollerr| Pollhup}], 1, +) = 1 ([{fd=3, Revents=pollin}]) 1583 Recvfrom (3, "$44\r\n{\" allyid\ ": \" 60979\ ", \" appid\ ": \" "..., 8192 , msg_dontwait, NULL, NULL) = 511584 Write (1, "{\" "allyid\": \ "60979\", \ "appid\": \ "ex_mm" ..., () = 441585 write (1, "\ n", 1) = 1
In 1572 rows, after the Get command is sent, the call to Poll,timeout passes the 0,1573 line again to call Poll,timeout into 2000.
Excuse me, why do we call two times poll? Can I just call once?
Reply content:
$host = '127.0.0.1';$port = 8888;$key = 'group:32149904:binding';$redis = new Redis();$redis->pconnect($host, $port);$obj = $redis->get($key);echo $obj, PHP_EOL;
PHP code is the above, and then I strace a bit, the result is as follows
1565 Connect (3, {sa_family=af_inet, sin_port=htons (6080), sin_addr=inet_addr ("10.83.73.168")}, +) = 1 einprogress ( Operation now in progress) 1566 poll ([{fd=3, events=pollin| Pollout| pollerr| Pollhup}], 1, +) = 1 ([{fd=3, revents=pollout}]) 1567 getsockopt (3, Sol_socket, So_error, [0], [4]) = 01568 fcntl (3, f_s ETFL, O_RDWR) = 01569 setsockopt (3, Sol_tcp, Tcp_nodelay, [1], 4) = 01570 poll ([{fd=3, events=pollin| pollpri| pollerr| Pollhup}], 1, 0) = 0 (Timeout) 1571 sendto (3, "*2\r\n$3\r\nget\r\n$22\r\ngroup:32149904" ..., 0) = 4 21572 poll ([{fd=3, events=pollin| pollpri| pollerr| Pollhup}], 1, 0) = 0 (Timeout) 1573 poll ([{fd=3, events=pollin| pollerr| Pollhup}], 1, +) = 1 ([{fd=3, Revents=pollin}]) 1574 recvfrom (3, "$44\r\n{\" allyid\ ": \" 60979\ ", \" appid\ ": \" "..., 8192 , msg_dontwait, NULL, NULL) = 511575 Write (1, "{\" "allyid\": \ "60979\", \ "appid\": \ "ex_mm" ..., () = 441576 write (1, "\ n", 1) = 11577 Poll ([{fd=3, events=pollin| pollpri| pollerr|Pollhup}], 1, 0) = 0 (Timeout) 1578 setsockopt (3, Sol_tcp, Tcp_nodelay, [1], 4) = 01579 poll ([{fd=3, events=pollin| pollpri| pollerr| Pollhup}], 1, 0) = 0 (Timeout) 1580 SendTo (3, "*2\r\n$3\r\nget\r\n$22\r\ngroup:32149904" ..., 0) = 4 21581 poll ([{fd=3, events=pollin| pollpri| pollerr| Pollhup}], 1, 0) = 0 (Timeout) 1582 poll ([{fd=3, events=pollin| pollerr| Pollhup}], 1, +) = 1 ([{fd=3, Revents=pollin}]) 1583 Recvfrom (3, "$44\r\n{\" allyid\ ": \" 60979\ ", \" appid\ ": \" "..., 8192 , msg_dontwait, NULL, NULL) = 511584 Write (1, "{\" "allyid\": \ "60979\", \ "appid\": \ "ex_mm" ..., () = 441585 write (1, "\ n", 1) = 1
In 1572 rows, after the Get command is sent, the call to Poll,timeout passes the 0,1573 line again to call Poll,timeout into 2000.
Excuse me, why do we call two times poll? Can I just call once?