当前位置:首页>Linux>嵌入式 Linux 多进程 IPC 通信方式很多,如何选择?

嵌入式 Linux 多进程 IPC 通信方式很多,如何选择?

  • 2026-03-25 20:47:36
嵌入式 Linux 多进程 IPC 通信方式很多,如何选择?

星标公众号,让嵌入式知识 “投喂” 不停歇!

大家好,我是杂烩君。

在嵌入式Linux开发中,多进程架构是实现模块化、提升系统可靠性的重要手段。本文带大家梳理消息队列、共享内存、UNIX域套接字、管道、信号量、信号六种进程间通信(IPC)机制的区别及使用场景。

如何选型?

在实际嵌入式项目中,选择哪种IPC方式取决于具体需求:

  • 需要传输大量数据且追求极致性能? → 共享内存 + 信号量
  • 需要结构化消息的异步传递? → 消息队列
  • 需要双向通信且接口要灵活? → UNIX域套接字
  • 父子进程间简单的数据流传递? → 管道
  • 仅需要通知/同步,不传输数据? → 信号或信号量
  • 需要跨主机通信? → TCP/IP套接字

什么是进程

1、进程和线程的区别

进程是指正在运行的程序,它拥有独立的内存空间和系统资源,不同进程之间的数据不共享。进程是资源分配的基本单位。

线程是进程内的执行单元,它与同一进程内的其他线程共享进程的内存空间和系统资源。线程是调度的基本单位。

下面用图来对比两者的关系——进程之间相互隔离,而同一进程内的线程共享地址空间:

进程间通信方式

每个进程各自有不同的用户地址空间,任何一个进程的全局变量在另一个进程中都看不到,进程间通信是指在不同进程之间传播或交换信息的一种机制。

进程间通信的目的:

  • 传输数据。比如进程 A 负责生成数据,进程 B 负责处理数据,数据需要从 A 进程传输至 B 进程。
  • 共享资源。比如进程 A 与进程 B 共享某一块内存资源。
  • 模块化。将系统功能划分为多个进程模块进行开发,方便开发维护。
  • 加速计算。多核处理器环境,一个特定进程划分为几个进程并行运行。

Linux IPC(Inter-process Communication, 进程间通信)的方式:

下面先通过一张对比表快速了解各种IPC方式的特点,再逐一深入讲解:

IPC方式
传输速度
实现复杂度
数据拷贝次数
适用场景
共享内存
最快
较高(需配合同步机制)
0
大数据量、高频交互
UNIX域套接字
较快
中等
2
C/S架构、双向通信
消息队列
中等
中等
2
结构化消息、异步传递
管道
中等
较低
2
简单的父子/相关进程通信
信号量
较低
同步互斥(非数据传输)
信号
较低
事件通知(非数据传输)

1、消息队列

内核中的一个优先级队列,多个进程通过访问同一个队列,进行添加结点或者获取结点实现通信。

下图展示了消息队列的工作原理——发送方将消息按优先级插入队列,接收方从队列头部取出消息:

POSIX消息队列头文件:

#include<fcntl.h>           /* For O_* constants */#include<sys/stat.h>        /* For mode constants */#include<mqueue.h>

编译链接需要加上 -lrt 链接。

消息队列基本API接口使用例子:发送进程给接收进程发送测试数据。

本例子消息队列通信的完整流程如下:

send.c:

#include<stdio.h>#include<stdlib.h>#include<string.h>#include<unistd.h>#include<fcntl.h>           /* For O_* constants */#include<sys/stat.h>        /* For mode constants */#include<mqueue.h>#define MQ_MSG_MAX_SIZE    512   ///< 最大消息长度 #define MQ_MSG_MAX_ITEM    5     ///< 最大消息数目staticmqd_t s_mq;typedefstruct _msg_data{char buf[128];int cnt;}msg_data_t;voidsend_data(void){staticint cnt = 0;msg_data_t send_data = {0};    cnt++;strcpy(send_data.buf, "hello");    send_data.cnt = cnt;int ret = mq_send(s_mq, (char*)&send_data, sizeof(send_data), 0);if (ret < 0)    {        perror("mq_send error");return;    }printf("send msg = %s, cnt = %d\n", send_data.buf, send_data.cnt);}intmain(void){int ret = 0;structmq_attrattr;///< 创建消息队列memset(&attr, 0sizeof(attr));    attr.mq_maxmsg = MQ_MSG_MAX_ITEM;    attr.mq_msgsize = MQ_MSG_MAX_SIZE;    attr.mq_flags = 0;    s_mq = mq_open("/mq", O_CREAT|O_RDWR, 0777, &attr);if(-1 == s_mq)    {        perror("mq_open error");return-1;    }for (size_t i = 0; i < 10; i++)    {        send_data();        sleep(1);    }    mq_close(s_mq);return0;}

recv.c:

#include<stdio.h>#include<stdlib.h>#include<string.h>#include<unistd.h>#include<fcntl.h>           /* For O_* constants */#include<sys/stat.h>        /* For mode constants */#include<mqueue.h>#define MQ_MSG_MAX_SIZE    512   ///< 最大消息长度 #define MQ_MSG_MAX_ITEM    5     ///< 最大消息数目staticmqd_t s_mq;typedefstruct _msg_data{char buf[128];int cnt;}msg_data_t;intmain(void){msg_data_t recv_data = {0};int prio = 0;ssize_t len = 0;    s_mq = mq_open("/mq", O_RDONLY);if(-1 == s_mq)    {        perror("mq_open error");return-1;    }while (1)    {if((len = mq_receive(s_mq, (char*)&recv_data, MQ_MSG_MAX_SIZE, &prio)) == -1)        {            perror("mq_receive error");return-1;        }printf("recv_msg = %s, cnt = %d\n", recv_data.buf, recv_data.cnt);        sleep(1);    }    mq_close(s_mq);    mq_unlink("/mq");return0;}

编译、运行:

gcc send.c -o send_process -lrtgcc recv.c -o recv_process -lrt

2、共享内存

消息队列的读取和写入的过程,会有发生用户态与内核态之间的消息拷贝过程。而共享内存的方式则没有这个拷贝过程,进程间通信速度较快。

在物理内存上开辟一块内存空间,多个进程可以将同一块物理内存空间映射到自己的虚拟地址空间,通过自己的虚拟地址直接访问这块空间,通过这种方式实现数据共享。

下图展示了共享内存的核心原理——多个进程的虚拟地址通过页表映射到同一块物理内存,实现零拷贝通信:

对比消息队列需要两次数据拷贝,共享内存的优势一目了然:

POSIX共享内存头文件:

#include<sys/mman.h>#include<sys/stat.h>#include<unistd.h>

共享内存基本API接口使用例子:发送进程给接收进程发送测试数据。

send.c:

#include<stdio.h>#include<stdlib.h>#include<string.h>#include<unistd.h>#include<fcntl.h>           /* For O_* constants */#include<sys/stat.h>        /* For mode constants */#include<sys/mman.h>#include<semaphore.h>#define SHM_NAME "/shm"#define SEM_NAME "/shm_sem"intmain(void){///< 创建信号量,初始值为0,表示数据尚未就绪sem_t *sem = sem_open(SEM_NAME, O_CREAT, 06660);if (sem == SEM_FAILED)    {        perror("sem_open error");return-1;    }///< 创建和读端相同的文件标识int shm_fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, 0666);if (shm_fd == -1    {        perror("shm_open error");return-1;    }///< 设置共享内存文件为8KB    ftruncate(shm_fd , 8 * 1024);///< 获取共享内存文件相关属性信息structstatfilestat = {0};    fstat(shm_fd, &filestat);printf("st_size = %ld\n",filestat.st_size);///< 内存映射char *shm_ptr = (char*)mmap(NULL, filestat.st_size, PROT_READ|PROT_WRITE, MAP_SHARED, shm_fd, 0);    close(shm_fd);///< 向共享内存中写入数据char buf[] = "hello world";    memmove(shm_ptr, buf, sizeof(buf));printf("pid %d, %s\n", getpid(), shm_ptr);///< 写入完成,通知接收方数据已就绪    sem_post(sem);///< 解除映射,关闭信号量    munmap(shm_ptr, filestat.st_size);    sem_close(sem);return0;}

recv.c:

#include<stdio.h>#include<stdlib.h>#include<string.h>#include<unistd.h>#include<fcntl.h>           /* For O_* constants */#include<sys/stat.h>        /* For mode constants */#include<sys/mman.h>#include<semaphore.h>#define SHM_NAME "/shm"#define SEM_NAME "/shm_sem"intmain(void){///< 打开信号量sem_t *sem = sem_open(SEM_NAME, O_CREAT, 06660);if (sem == SEM_FAILED)    {        perror("sem_open error");return-1;    }///< 创建共享内存文件标识符int shm_fd = shm_open(SHM_NAME, O_RDWR | O_CREAT, 0666);if (shm_fd == -1    {        perror("shm_open failed");exit(EXIT_FAILURE);    }///< 设置共享内存文件为8KB    ftruncate(shm_fd , 8192);///< 获取共享内存文件相关属性信息structstatfilestat;    fstat(shm_fd, &filestat);printf("st_size = %ld\n",filestat.st_size);///< 映射共享内存,并获取共享内存的地址char *shm_ptr = (char*)mmap(NULL, filestat.st_size, PROT_READ|PROT_WRITE, MAP_SHARED, shm_fd, 0);    close(shm_fd);///< 等待发送方写入完成    sem_wait(sem);///< 获取共享内存地址中的内容并打印printf("pid = %d, %s\n", getpid(), shm_ptr);///< 解除映射,清理信号量和共享内存    munmap(shm_ptr, filestat.st_size);    shm_unlink(SHM_NAME);    sem_close(sem);    sem_unlink(SEM_NAME);return0;}

编译、运行:

gcc send.c -o send_process -lrtgcc recv.c -o recv_process -lrt

对具有多个处理核系统消息传递的性能要优于共享内存。共享内存会有高速缓存一致性问题,这是由共享数据在多个高速缓存之间迁移而引起的。随着系统的处理核的数量的日益增加,可能导致消息传递作为 IPC 的首选机制。

注意: 共享内存本身不提供任何同步机制。上面的示例使用有名信号量(初始值为0)实现了"写完再读"的同步:发送方写入后 sem_post 将信号量加1,接收方 sem_wait 阻塞直到信号量大于0才读取。生产代码中如果涉及多读多写的并发场景,还需要进一步使用互斥锁保护临界区。

3、socket

消息队列和共享内存适合数据传输,但如果需要像网络编程一样灵活的双向通信,UNIX域套接字是更好的选择。

UNIX域套接字与传统基于TCP/IP协议栈的socket不同,unix domain socket以文件系统作为地址空间,不需经过TCP/IP的头部封装、报文ack确认、路由选择、数据校验与重传过程,因此传输速率上也不会受网卡带宽的限制。

unix domain socket在进程间通信同样是基于“客户端—服务器”(C-S)模式。

UNIX 域套接字与 TCP/IP 套接字的对比:

UNIX域套接字基本API接口使用例子:基于UNIX域套接字客户端进程向服务端进程发送测试数据。

下图展示了 UNIX 域套接字的 C/S 通信建立过程:

server.c:

#include<stdio.h>#include<stdlib.h>#include<string.h>#include<unistd.h>#include<fcntl.h>           /* For O_* constants */#include<sys/stat.h>        /* For mode constants */#include<sys/socket.h>#include<netinet/in.h>#include<arpa/inet.h>#include<sys/un.h>#define SERVER_PATH "/tmp/server"intmain(void){///< 创建UNIX域字节流套接字int server_fd = socket(AF_LOCAL, SOCK_STREAM, 0);if(server_fd < 0)    {printf("socket error\n");exit(EXIT_FAILURE);    }///< 绑定服务端地址    unlink(SERVER_PATH);structsockaddr_unserver_addr;memset((char*)&server_addr, 0sizeof(server_addr));    server_addr.sun_family = AF_LOCAL;strncpy(server_addr.sun_path, SERVER_PATH, sizeof(server_addr.sun_path)-1);if(bind(server_fd, (struct sockaddr*)&server_addr, sizeof(server_addr)) < 0)    {printf("bind error\n");        close(server_fd);exit(EXIT_FAILURE);    }///< 监听if(listen(server_fd, 10) < 0)       {printf("listen error\n");        close(server_fd);exit(EXIT_FAILURE);    }///< 等待客户端连接int addr_len = sizeof(struct sockaddr);structsockaddr_unclient_addr;int client_fd = accept(server_fd, (struct sockaddr*)&client_addr, (socklen_t *)&addr_len);if(client_fd < 0)    {printf("accept error\n");        close(server_fd);        unlink(SERVER_PATH);exit(1);     }else    {printf("connected client: %s\n", client_addr.sun_path);    }while(1)    {char buf[128] = {0};int recv_len = read(client_fd, buf, sizeof(buf)); if(recv_len <= 0)        {printf("recv error!\n");            close(client_fd);exit(EXIT_FAILURE);        }printf("recv : %s\n", buf);    }    unlink(SERVER_PATH);    close(server_fd);    close(client_fd);return0;}

client.c:

#include<stdio.h>#include<stdlib.h>#include<string.h>#include<unistd.h>#include<fcntl.h>           /* For O_* constants */#include<sys/stat.h>        /* For mode constants */#include<sys/socket.h>#include<netinet/in.h>#include<arpa/inet.h>#include<sys/un.h>#define SERVER_PATH "/tmp/server"#define CLIENT_PATH "/tmp/client"intmain(void){///< 创建UNIX域字节流套接字int client_fd = socket(AF_UNIX, SOCK_STREAM, 0);if(client_fd < 0)    {printf("socket error\n");exit(EXIT_FAILURE);    }///< 显式绑定客户端地址structsockaddr_unclient_addr;memset((char*)&client_addr, 0sizeof(client_addr));    client_addr.sun_family = AF_UNIX;strncpy(client_addr.sun_path, CLIENT_PATH, sizeof(client_addr.sun_path)-1);    unlink(CLIENT_PATH);if(bind(client_fd, (struct sockaddr*)&client_addr, sizeof(client_addr)) < 0)    {printf("bind error\n");        close(client_fd);exit(1);     }///< 连接服务端structsockaddr_unserver_addr;    server_addr.sun_family  = AF_UNIX;strncpy(server_addr.sun_path, SERVER_PATH, sizeof(server_addr.sun_path)-1);int ret = connect(client_fd, (struct sockaddr*)&server_addr, sizeof(server_addr)); if(ret < 0)    {printf("connect error\n");        close(client_fd);        unlink(CLIENT_PATH);exit(1);      } printf("connect to server: %s\n", server_addr.sun_path);while(1)    {char buf[128] = {0};if (scanf("%s", buf))        {int send_len = write(client_fd, buf, strlen(buf));if (send_len <= 0)            {printf("write error!\n");                close(client_fd);exit(EXIT_FAILURE);              }else            {printf("send success! send: %s, send_len: %d\n", buf, send_len);            }        }     }    unlink(SERVER_PATH);    close(client_fd);return0;}

编译、运行:

gcc server.c -o server_processgcc client.c -o client_process

类socket的其它进程间通信方式:

一个嵌入式系统进程间通信利器!

4、管道

前面介绍的消息队列、共享内存和UNIX域套接字功能强大但使用相对复杂。如果只是父子进程间简单的数据传递,管道(Pipe)是最轻量的选择。

在内核中开辟一块缓冲区;若多个进程拿到同一个管道(缓冲区)的操作句柄,就可以访问同一个缓冲区,就可以进行通信。涉及到两次用户态与内核态之间的数据拷贝。

(1)匿名管道

内核中的缓冲区是没有具体的标识符的,匿名管道只能用于具有亲缘关系的进程间通信。

调用pipe接口可以创建一个匿名管道,并返回了两个描述符,一个是管道的读取端描述符 fd[0],另一个是管道的写入端描述符 fd[1]

管道是一个半双工通信(可以选择方向的单向传输)

匿名管道的工作原理——父进程 fork 出子进程后,两者共享管道的文件描述符:

匿名管道基本API接口使用例子:父进程通过管道发送测试数据给子进程。

#include<stdio.h>#include<stdlib.h>#include<unistd.h>#include<string.h>intmain(){///< 创建管道int pipefd[2] = {-1};int ret = pipe(pipefd);if (ret < 0)    {printf("pipe error\n");exit(EXIT_FAILURE);    }int read_fd = pipefd[0];   ///< pipefd[0] 用于从管道中读取数据int write_fd = pipefd[1];  ///< pipefd[1] 用于向管道中写入数据///< 创建子进程pid_t pid = fork();if (pid == 0)    {///< 子进程从管道读取数据  char buf[128] = {0};        read(read_fd, buf, sizeof(buf));printf("child recv data from father: %s", buf);    }elseif (pid > 0)   {///< 父进程向管道写入数据char *ptr = "hello88888888\n";        write(write_fd, ptr, strlen(ptr));    }return0;}

编译、运行:

如果需要双向通信,则应该创建两个管道。

(2)命名管道

命名管道也是内核中的一块缓冲区,并且这个缓冲区具有标识符;这个标识符是一个可见于文件系统的管道文件,能够被其他进程找到并打开管道文件,则可以获取管道的操作句柄,所以该命名管道可用于同一主机上的任意进程间通信。

命名管道与匿名管道的关键区别——命名管道通过文件系统中可见的 FIFO 文件来建立连接,任意进程都能访问:

创建命名管道的接口:

intmkfifo(constchar *pathname, mode_t mode);

命名管道基本API接口使用例子:一个进程往管道中写入测试数据,另一个进程从管道中读取数据。

fifo_wr.c:

#include<stdio.h>#include<stdlib.h>#include<string.h>#include<fcntl.h>#include<sys/stat.h>#include<unistd.h>#include<errno.h>#define FIFO_PATH  "./fifo_file"typedefstruct _msg_data{char buf[128];int cnt;}msg_data_t;voidsend_data(int fd){staticint cnt = 0;msg_data_t send_data = {0};    cnt++;strcpy(send_data.buf, "hello");    send_data.cnt = cnt;    write(fd, &send_data, sizeof(send_data));printf("send msg = %s, cnt = %d\n", send_data.buf, send_data.cnt);}intmain(void){///< 创建管道文件int ret = mkfifo(FIFO_PATH, 0664);if (ret < 0 && errno != EEXIST)    {printf("mkfifo error\n");exit(EXIT_FAILURE);    }///< 以只写的方式打开管道文件int fd = open(FIFO_PATH, O_WRONLY);if (fd < 0)    {printf("open fifo error\n");exit(EXIT_FAILURE);    }printf("open fifo success\n");///< 写10次for (size_t i = 0; i < 10; i++)    {        send_data(fd);        sleep(1);    }    close(fd);return0;}

fifo_rd.c:

#include<stdio.h>#include<stdlib.h>#include<unistd.h>#include<string.h>#include<sys/stat.h>#include<errno.h>#include<fcntl.h>#define FIFO_PATH  "./fifo_file"typedefstruct _msg_data{char buf[128];int cnt;}msg_data_t;intmain(void){    umask(0);///< 创建管道文件int ret = mkfifo(FIFO_PATH,0664 );if (ret < 0 && errno != EEXIST)    {printf("mkfifo error\n");exit(EXIT_FAILURE);    }///< 以只读方式获取管道文件的操作句柄int fd = open(FIFO_PATH, O_RDONLY);if (fd < 0)    {printf("open error\n");exit(EXIT_FAILURE);    }printf("open fifo success\n");while(1)    {msg_data_t read_data = {0};///< 将从管道读取的文件写到buf中int ret = read(fd, &read_data, sizeof(read_data));if (ret < 0)        {printf("read error\n");exit(EXIT_FAILURE);        }elseif (ret == 0)        {printf("all write closed\n");exit(EXIT_FAILURE);        }printf("read_data = %s, cnt = %d\n", read_data.buf, read_data.cnt);        sleep(1);    }    close(fd);return0;}

编译、运行:

gcc fifo_wr.c -o fifo_wrgcc fifo_rd.c -o fifo_rd

5、信号量

前面介绍的IPC方式都是用于进程间传输数据的,但在多进程协作中还有一个关键问题——同步与互斥。信号量正是解决这个问题的利器。

信号量(Semaphore)是进程和线程间同步的一种机制。

信号量本质是一个非负的整型变量。增加一个可用资源执行加一,也称为V操作;获取一个资源资源后执行减一,也称为P操作。

下图展示了信号量的 P/V 操作原理——以一个停车场为例来理解信号量:

信号量根据信号值不同可分为两类:

  • 二值信号量,信号量值只有0和1,初始值为1,1表示资源可用,0表示资源不可用;二值信号量与互斥锁类似。
  • 计数信号量, 信号量的值在0到一个大于1的限制值之间,信号值表示可用的资源的数目。

信号量根据作用对象不同可分为两类:

  • 有名信号量,信号值保存在文件中,用于进程间同步
  • 无名信号量,又称为基于内存信号量,信号值保存在内存中,用于线程间同步

POSIX信号量头文件:

#include<semaphore.h>

编译链接需要加-lpthread参数。

信号量基本API接口使用例子:父子进程间通信

#include<stdio.h>#include<stdlib.h>#include<unistd.h>#include<semaphore.h>#include<fcntl.h>#define SEM_NAME "sem"intmain(void){int sem_val = 0;///< 创建信号量sem_t *sem = sem_open(SEM_NAME, O_CREAT, 06661);if (NULL == sem)    {printf("sem_open error\n");exit(EXIT_FAILURE);     }///< 创建子进程pid_t pid = fork();if (pid == -1    {printf("fork error\n");        sem_close(sem);        sem_unlink(SEM_NAME);exit(EXIT_FAILURE);    }elseif(pid == 0    {///< 子进程进行5次P操作for (size_t i = 0; i < 5; i++)        {            sem_wait(sem);if (sem_getvalue(sem, &sem_val) != -1            {printf("child process P operation, sem_val = %d\n", sem_val);                sleep(1);            }        }        _exit(1);    }elseif (pid > 0)    {///< 父进程执行5次V操作for (size_t i = 0; i < 5; i++)        {            sem_post(sem);if (sem_getvalue(sem, &sem_val) != -1            {printf("parent process V operation, sem_val = %d\n", sem_val);                sleep(2);            }        }    }///< 删除sem信号量    sem_close(sem);if (sem_unlink(SEM_NAME) != -1    {printf("sem_unlink success\n");    }return0;}

编译、运行:

6、信号(Signal)

与上面介绍的IPC方式不同,信号不用于传输数据,而是一种轻量级的异步通知机制,用于告知目标进程某个事件已经发生。在嵌入式开发中,信号常用于优雅关闭进程(SIGTERM)、父子进程协调(SIGCHLD)、定时任务(SIGALRM)等场景。

下图展示了信号的工作原理——信号就像一个"拍肩膀"的动作,告诉目标进程"有事发生了":

常见的信号:

信号
说明
SIGINT
2
终端中断(Ctrl+C)
SIGKILL
9
强制终止进程(不可捕获)
SIGTERM
15
请求终止进程(可捕获)
SIGCHLD
17
子进程状态改变时通知父进程
SIGUSR1
10
用户自定义信号1
SIGUSR2
12
用户自定义信号2
SIGALRM
14
定时器超时

信号处理的核心API:

#include<signal.h>// 注册信号处理函数(简易版)typedefvoid(*sighandler_t)(int);sighandler_tsignal(int signum, sighandler_t handler);// 注册信号处理函数(推荐,功能更强大)intsigaction(int signum, const struct sigaction *act, struct sigaction *oldact);// 向指定进程发送信号intkill(pid_t pid, int sig);

信号基本使用例子:父进程通过信号通知子进程执行特定操作。

#include<stdio.h>#include<stdlib.h>#include<unistd.h>#include<signal.h>#include<sys/wait.h>voidsigusr1_handler(int sig){constchar msg[] = "child process received SIGUSR1\n";    write(STDOUT_FILENO, msg, sizeof(msg) - 1);}intmain(void){pid_t pid = fork();if (pid == 0)    {///< 子进程注册SIGUSR1信号处理函数,然后挂起等待信号        signal(SIGUSR1, sigusr1_handler);printf("child process waiting for signal...\n");        pause();printf("child process exiting\n");        _exit(0);    }elseif (pid > 0)    {        sleep(1);///< 父进程向子进程发送SIGUSR1信号printf("parent process sending SIGUSR1 to child\n");        kill(pid, SIGUSR1);        wait(NULL);printf("parent process done\n");    }return0;}

注意: 信号处理函数中应尽量只调用异步信号安全(async-signal-safe)的函数,避免在信号处理函数中使用 printfmalloc 等非安全函数。

IPC总结

操作系统根据不同的场景提供了不同的IPC方式,下面回顾各种方式的核心特点:

消息队列: 内核中的一个优先级队列,多个进程通过访问同一个队列,在队列当中添加或者获取节点来实现进程间通信。

共享内存: 本质是一块物理内存,多个进程将同一块物理内存映射到自己的虚拟地址空间中,再通过页表映射到物理地址达到进程间通信,它是最快的进程间通信方式,相较其他通信方式少了两步数据拷贝操作。

UNIX域套接字: 与TCP/IP套接字使用方式相同,但UNIX域套接字以文件系统作为地址空间,不需经过TCP/IP的头部封装、报文ack确认、路由选择、数据校验与重传过程,因此传输速率上也不会受网卡带宽的限制。

管道: 内核中的一块缓冲区,分为匿名管道和命名管道。匿名管道只能用于具有亲缘关系的进程间;而命名管道可用于同一主机上任意进程间通信。

信号量: 本质是内核中的一个计数器,主要实现进程间的同步与互斥,对资源进行计数,有两种操作,分别是在访问资源之前进行的P操作(获取资源),还有产生资源之后的V操作(释放资源)。

信号: 一种轻量级的异步通知机制,不传输数据,仅用于通知目标进程某个事件已发生,常用于进程控制和异常处理。

你平时还有哪些想看的内容?欢迎评论区聊聊,说不定下一期就发出来。

期待你的三连支持!

精选文章:

Linux驱动课程:

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-03-27 11:26:23 HTTP/2.0 GET : https://f.mffb.com.cn/a/479091.html
  2. 运行时间 : 0.124279s [ 吞吐率:8.05req/s ] 内存消耗:4,823.32kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=dad20962ebaea93f54634db024d0c63c
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000340s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000468s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000284s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.004322s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000507s ]
  6. SELECT * FROM `set` [ RunTime:0.000193s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000619s ]
  8. SELECT * FROM `article` WHERE `id` = 479091 LIMIT 1 [ RunTime:0.001878s ]
  9. UPDATE `article` SET `lasttime` = 1774581983 WHERE `id` = 479091 [ RunTime:0.001216s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.000230s ]
  11. SELECT * FROM `article` WHERE `id` < 479091 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000551s ]
  12. SELECT * FROM `article` WHERE `id` > 479091 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000682s ]
  13. SELECT * FROM `article` WHERE `id` < 479091 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.009688s ]
  14. SELECT * FROM `article` WHERE `id` < 479091 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.025908s ]
  15. SELECT * FROM `article` WHERE `id` < 479091 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.007605s ]
0.126025s