First, the phenomenon
1. See if a process exists
Ps-ef | Grep-v ' grep ' |grep-e ' Shell/cron/bonus/cash '
www 2624 1 0 Oct24? 00:00:35/usr/local/bin/php/data1/www/htdocs/hb.e.weibo.com/v2/www/htdocs/index.php--uri=shell/cron/bonus/cash-
{Code ...} the above is the php code, and then I strace it, the result is as follows {code ...} after sending the get command in line 3, poll is called. The timeout value is the value of line 0, 1572, and the value of timeout is 2000. Why do I need
$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
With the full support of the 2.6 kernel to epoll, many articles and sample code on the network provide a message that using Epoll instead of the traditional poll can bring a performance boost to Web service applications. But most of the reasons for
1 select function
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);1.1 parameter description the first parameter NFDs is the maximum descriptor value added to the fdset set by 1. fdset is
SelectThe essence is to use 32-bit 32-bit integer, that is, 32*32 = 1024, And the FD value is 1-1024. When the FD value exceeds the 1024 limit, you must modify the fd_setsize. In this case, you can identify the FD in the 32 * max value range.
1. Basic knowledgeThe poll mechanism is similar to select in that there is no significant difference in nature with Select, that managing multiple descriptors is also polling and processing according to the state of the descriptor, but poll has no
First, review the previous Select
Select Advantages:
currently supported on almost all platforms, and its good cross-platform support is one of its advantages
Select Cons:
1. Each call to
Original URL: http://www.cnblogs.com/alyssaCui/archive/2013/04/01/2993886.htmlPollPoll or select is familiar to most unix/linux programmers, and these two things are similar in principle, there is no significant difference in performance, but Select
1.select ModelsThe 1.1 Select function is prototyped as follows, where Nfds represents the maximum value of the Descriptor plus 1 (because this is the left-right open interval), and the middle three parameters represent a collection of different
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.