$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 (
OneThe difference between select poll and Epoll, you can refer to the following three linkshttp://blog.csdn.net/turkeyzhou/article/details/8504554http://www.cnblogs.com/Anker/p/3265058.htmlhttp:// Www.cnblogs.com/zhuyp1015/p/3553320.htmlSummarizeThe three differences are as follows(1) The Select,poll implementation requires itself to constantly poll all FD collec
Turn: Summary of differences between SELECT, poll, Epoll [finishing]The select,poll,epoll is a mechanism for IO multiplexing. I/O multiplexing is a mechanism by which multiple descriptors can be monitored, and once a descriptor is ready (usually read-ready or write-ready), the program can be notified of the appropriate read and write operations. But select,poll,
Summary of differences between SELECT, poll and Epoll [finishing]The select,poll,epoll is a mechanism for IO multiplexing. I/O multiplexing is a mechanism by which multiple descriptors can be monitored, and once a descriptor is ready (usually read-ready or write-ready), the program can be notified of the appropriate read and write operations. But select,poll,epo
Function prototype
# Include Int poll (struct pollfd FDS [], nfds_t NFDs, int timeout );
Typedef struct pollfd {Int FD;/* file descriptor to be detected or selected */Short events;/* events of interest to the file descriptor FD */Short revents;/* events actually occurred on the file descriptor FD */} Pollfd_t;
Typedef unsigned long nfds_t;Parameter description:
FDS: an array of the struct pollfd structure to store the socket descriptor that needs to d
immediately gets a result. When the user process determines that the result is an error, it knows that the data is not ready, so it can send the read operation again. Once the data in the kernel is ready and again receives the system call of the user process, it immediately copies the data to the user's memory and then returns. Therefore, nonblocking IO is characterized by the user process needs to constantly proactively ask kernel data well no. I/O multiplexing (IO multiplexing) IO multiplexin
The poll function is similar to the SELECT functionFunction Prototypes:#include int poll (structint timeout);struct POLLFD is structured as follows:struct pollfd{ int// file descriptor short event;// requested event short revent;// event returned } Each pollfd struct specifies a monitored file descriptor. The first parameter is an array, that is, the poll f
(The following comes from the web and its own summary, thanks again for the insights provided by the great gods on the Web)Before exploring Select poll Epoll We first need to know what is called multiplexing:Come down and explore why multiplexing is used:first, let's look at the complete process of a client request server. First, the request comes in to establish a connection, then receive the data, receive the data, and then send the data.Specific to
The select,poll,epoll is a mechanism for IO multiplexing. I/O multiplexing is a mechanism by which multiple descriptors can be monitored, and once a descriptor is ready (usually read-ready or write-ready), the program can be notified of the appropriate read and write operations. but select,poll,epoll are essentially synchronous I/O, because they all need to read and write when the read-write event is ready,
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- -get=proc_num=1proc_total=1--post=
2. View process creation time
Ps-p 2624-o Lstart
Started
Sat OCT 24 22:20:03 2015
3. View system calls to the process
Strace-p 2624
Process 2624 Attached-interrupt to quit
Restart_syscall (... resuming interrupted call ...>)
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 has a limited number of file descriptors to monitor, so here's a poll to explain.1. Header files# include 2. Parameter descriptionint poll (struct POLLFD * FDS,
Description: Linux version 2.6.37.1
Combined with the summary of relevant data and summarized, to make a record, the wrong place please correct, thank you.
1.poll mechanism and wait queue
The application layer enters the kernel through the system call poll function, and the kernel executes the corresponding Sys_poll function. Call the Do_sys_poll function in the Sys_poll function. Do_sys_poll function by ca
Article reference from: http://blog.csdn.net/tennysonsky/article/details/45745887 (Akihabara-mike VS Mike "Linux system programming--i/o Multiplexing Select, poll, Epoll the difference between the use of ")
In addition, there is a good article: Epoll mechanism: epoll_create, Epoll_ctl, epoll_wait, close (fish think Yuan's column)
In the previous article, I simply learned the basic concept of IO multiplexing, and here I will learn three ways to achiev
The essence of Select is 32 bits with 32 integers, that is, the 32*32= 1024来 identifier, and the FD value is 1-1024. When the value of FD exceeds the 1024 limit, the size of the fd_setsize must be modified. At this time, you can identify the 32*max value range of FD.Select is not appropriate for single-process multi-threading, where each thread handles multiple FD.1. All threads are scanned from 1-32*max, and each thread is treated with an FD value, which is a bit wasteful2.1024 Upper limit prob
Select, poll, epoll (2)1. Select source code parsing is based on kernel code 2.6.28. select mainly contains four functions.Sys_select: process the time parameter, and then call core_sys_select.Core_sys_select: process three fd_set parameters (in, out, ex), and then call do_select.Do_select: traverses all fd and performs select/poll. Wait and call sock_poll at the right time.Sock_poll: Use a function pointer
About I/O multiplexing:I/O multiplexing (also known as "event-driven"), the first thing to understand is that the operating system provides you with a feature that can give you a notification when one of your sockets is readable or writable. This way, when used with a non-blocking socket, only if the system notifies me which descriptor is readable, I go to the read operation, can guarantee that every read can read the valid data without doing the pure return-1 and eagain of useless. Write operat
The difference between select, poll and Epoll
Select
Select was first seen in the 4.2BSD in 1983, and it was used by a select () system to monitor multiple file descriptor arrays (everything in Linux is file, block device, socket connection, etc.). ), when Select () returns, the ready file descriptor in the array is changed by the kernel to the flag bit Allows the process to obtain these file descriptors for subsequent read and write operations (sele
, the kernel to dispatch other process to run, passive loses CPU. (Hangs can be preempted by another process, causing it to hang, or to suspend itself on its own initiative.) ) 5 I/O models available under UNIX: 1, blocking I/O 2, non-blocking I/O 3,i/o multiplexing 4, signal-driven I/O (SIGIO) 5, asynchronous i/o1--4 for synchronous i/o,5 for asynchronous I/O. The I/O multiplexing we are concerned with is synchronous I/O, which causes the process to block.There are horizontal triggers in the IO
1. SelectSelect essentially processes the next step by setting or checking the data structure that holds the FD flag bit.Disadvantages:1) The number of FD that can be monitored by a single process is limited.2) The need to maintain a data structure to hold a large number of FD, which will make the user space and kernel space in the transfer of the structure when the replication overhead.3) A linear scan is performed when the FD is scanned. After the FD surge, the IO efficiency is low because eac
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.