当前位置:首页>Linux>【Linux 内核】 浅析 CFS 完全公平调度器工作原理

【Linux 内核】 浅析 CFS 完全公平调度器工作原理

  • 2026-06-29 14:38:52
【Linux 内核】 浅析 CFS 完全公平调度器工作原理

前言

本文结合 Linux 5.0.1 内核源码,浅析 Linux 进程管理中的完全公平调度器(CFS)工作原理。


1. 概述

完全公平调度器(Completely Fair Scheduler, CFS)自 Linux 内核 2.6.23 版本引入,是默认的进程调度算法,目标是在所有可运行进程之间公平地分配 CPU 时间。

CFS 的核心是 虚拟运行时间(vruntime)——可以理解为"考虑了优先级的已用 CPU 时间"。优先级高的进程,vruntime 增长得慢,因此能获得更多 CPU 时间。调度器始终选择 vruntime 最小的进程运行,从而让所有进程尽可能公平地共享 CPU。

vruntime 是调度决策的核心依据,但完整的调度行为还需考虑处理器亲和性、负载均衡、中断与唤醒事件等因素。

源码结构关系,请参考本章 核心结构 部分内容。


2. 虚拟运行时间调度

在 Linux 的完全公平调度器(CFS)设计中,每个 CPU 核心都拥有一个独立的调度域,其就绪队列使用一棵 红黑树 来组织。这棵树的排序关键字是每个进程的 “虚拟运行时间”(vruntime)。

核心机制与 vruntime 的作用:

  1. 排序依据:进程的 vruntime 值决定了它在红黑树中的位置,值越小,位置越靠左。
  2. 调度选择:调度器总是挑选 vruntime 最小的(即红黑树最左侧的)进程投入运行,这保证了最 “饥饿” 的进程能优先获得 CPU。
  3. 公平的实现:进程在 CPU 上运行后,其 vruntime 会随之增长,这使它逐渐向右移动,让位于其他 vruntime 更小的进程。高优先级进程(nice 值小 - 权重大)的 vruntime 增长更慢,因此能更频繁地被调度,从而获得更多的实际 CPU 时间。

2.1. vruntime

vruntime 它表示该进程在 CPU 上实际运行的时间经过加权后的结果。

调度器会优先选择 vruntime 值最小的进程运行,以确保每个进程的 vruntime 尽可能接近,从而实现公平的 CPU 时间分配。

新 vruntime = 旧 vruntime + 任务实际运行时间 × (nice 0 的权重 / 当前权重)

从时间计算公式可知:weight 权重越大 → vruntime 涨得越慢 → 更容易抢到 CPU。

相关结构体详见 核心结构 章节。


2.2. 红黑树管理 vruntime

在 CFS 调度器中,所有可运行任务都作为调度实体按虚拟运行时间(vruntime)组织在红黑树中。 该红黑树通过运行队列的 rq.cfs.tasks_timeline 字段进行管理。

系统在每次调度时,从红黑树中获取最左侧节点(即 vruntime 最小的调度实体)进行调度。 这意味着任务的 vruntime 值越小,其调度优先级越高,越有可能获得 CPU 时间。

下图中,vruntime 最小的节点(值为 10)位于红黑树最左侧,它将是下一个被调度的任务。

调度实体节点入队逻辑(进入任务就绪队列):

// 比较两个调度实体的 vruntime 大小staticinlineintentity_before(struct sched_entity *a, struct sched_entity *b){return (s64)(a->vruntime - b->vruntime) < 0;}// 将调度实体按 vruntime 插入红黑树staticvoid __enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se) {structrb_node **link = &cfs_rq->tasks_timeline.rb_root.rb_node;structrb_node *parent = NULL;structsched_entity *entry;bool leftmost = true// 标记是否将成为最左节点// 从根节点遍历红黑树,寻找合适的插入位置while (*link) {        parent = *link;// 从 rb_node 获取包含它的 sched_entity        entry = rb_entry(parent, struct sched_entity, run_node);if (entity_before(se, entry)) {            link = &parent->rb_left;   // vruntime 更小,走左子树        } else {            link = &parent->rb_right;  // vruntime 更大或相等,走右子树            leftmost = false;        }    }// 将新节点链接到父节点下    rb_link_node(&se->run_node, parent, link);// 调整红黑树平衡,并更新缓存的最左节点    rb_insert_color_cached(&se->run_node, &cfs_rq->tasks_timeline, leftmost);}

2.3. vruntime 更新

update_curr 负责更新当前运行任务的 vruntime,在任何可能影响运行时间计算的时刻被调用。

staticvoidupdate_curr(struct cfs_rq *cfs_rq){structsched_entity *curr = cfs_rq->curr;// 获取任务时钟(不含中断时间)  u64 now = rq_clock_task(rq_of(cfs_rq));  u64 delta_exec;  ...  delta_exec = now - curr->exec_start;  ...  curr->exec_start = now;  ...// 根据权重计算加权虚拟时间:权重越大 → vruntime 增长越慢  curr->vruntime += calc_delta_fair(delta_exec, curr);  ...}

calc_delta_fair 根据任务权重调整 vruntime 增量,内部调用 __calc_delta 完成计算。

staticinline u64 calc_delta_fair(u64 delta, struct sched_entity *se){if (unlikely(se->load.weight != NICE_0_LOAD)) {    delta = __calc_delta(delta, NICE_0_LOAD, &se->load);  }return delta;}

2.4. 进程任务调度

调度函数(__schedule)从当前 CPU 的任务就绪队列 cfs_rq 中取出一个合适的任务进行调度。

__schedule -> cur cpu -> rq -> cfs_rq-> pick_next_task -> fair_sched_class -> pick_next_task_fair -> context_switch(rq, prev, next)

核心调度函数 __schedule

// 核心调度函数:选择下一个任务并执行上下文切换staticvoid __sched notrace __schedule(bool preempt) {structtask_struct *prev, *next;structrq *rq;int cpu;  cpu = smp_processor_id();    // 获取当前 CPU ID  rq = cpu_rq(cpu);            // 获取当前 CPU 的运行队列  prev = rq->curr;             // 当前正在运行的任务  ...// 从运行队列中选择下一个要运行的任务  next = pick_next_task(rq, prev, &rf);  ...if (likely(prev != next)) {    ...    rq->curr = next;    ...// 保存 prev 上下文,加载 next 上下文    rq = context_switch(rq, prev, next, &rf);  }  ...}

创建任务时根据优先级绑定调度器:

intsched_fork(unsignedlong clone_flags, struct task_struct *p){  ...if (dl_prio(p->prio)) {return -EAGAIN;  } elseif (rt_prio(p->prio)) {    p->sched_class = &rt_sched_class;  } else {// 普通优先级进程使用完全公平调度器调度    p->sched_class = &fair_sched_class;  }  ...}

选择下一个运行任务(优先走 CFS 快速路径,否则遍历所有调度类):

staticinline struct task_struct *pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf){conststructsched_class *class;structtask_struct *p;// 快速路径:所有任务都在 CFS 中,直接选择if (likely((prev->sched_class == &idle_sched_class ||      prev->sched_class == &fair_sched_class) &&      rq->nr_running == rq->cfs.h_nr_running)) {    p = fair_sched_class.pick_next_task(rq, prev, rf);if (unlikely(p == RETRY_TASK))goto again;if (unlikely(!p))      p = idle_sched_class.pick_next_task(rq, prev, rf);return p;  }again:// 按优先级从高到低遍历所有调度类  for_each_class(class) {    p = class->pick_next_task(rq, prev, rf);if (p) {if (unlikely(p == RETRY_TASK))goto again;return p;    }  }  ...}

CFS 选择 vruntime 最小的调度实体作为下一个任务:

static struct task_struct *pick_next_task_fair(struct rq *rq, struct task_struct *prev, struct rq_flags *rf){structcfs_rq *cfs_rq = &rq->cfs;structsched_entity *se;structtask_struct *p;  ...structsched_entity *curr = cfs_rq->curr;  ...// 从红黑树中选择 vruntime 最小的调度实体  se = pick_next_entity(cfs_rq, curr);// 从调度实体获取对应的 task_struct  p = task_of(se);  ...// 将前一个任务放回运行队列  put_prev_entity(cfs_rq, &prev->se);// 将选中的任务从队列取出,准备运行  set_next_entity(cfs_rq, se);  ...return p;}

3. 核心结构

为了进一步理解 CFS 的调度源码,下面简单地梳理一下相关的数据结构关系。

3.1. 调度结构关系

结构
描述
rq
每 CPU 运行队列,管理该 CPU 上所有可运行任务,包含 cfs_rq、rt_rq 等子队列。
cfs_rq
CFS 运行队列,用红黑树按 vruntime 排序调度实体,最左节点即下一个调度目标。
task_struct
进程/线程核心结构,包含 PID、优先级、状态、调度实体等信息。
sched_entity
调度实体,调度器的基本操作单元,存储 vruntime、权重等调度信息。
sched_class
调度类接口,定义 enqueue_task、pick_next_task 等操作,不同调度策略各自实现。

3.2. 结构描述

3.2.1. 运行队列 rq

// 每 CPU 一个运行队列,缓存行对齐DECLARE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);structrq {unsignedint nr_running;    // 可运行任务总数structcfs_rqcfs;// CFS 运行队列structtask_struct *curr;// 当前运行任务  u64 clock_task;             // 任务时钟(不含中断时间)};

3.2.2. 完全公平调度运行队列 cfs_rq

structload_weight {unsignedlong weight;       // 权重越大,vruntime 增长越慢  ...};structcfs_rq {structload_weightload;unsignedlong runnable_weight; // 队列总权重,用于负载均衡unsignedint nr_running;       // 可运行任务数unsignedint h_nr_running;     // 层级任务计数(CGroup)  u64 exec_clock;                // 累计执行时间  u64 min_vruntime;              // 队列最小 vruntimestructrb_root_cachedtasks_timeline;// 红黑树structsched_entity *curr;structsched_entity *next;structrq *rq;  ...};// 缓存最左节点,O(1) 获取最小 vruntimestructrb_root_cached {structrb_rootrb_root;structrb_node *rb_leftmost;};

3.2.3. 进程结构 task_struct

structtask_struct {structthread_infothread_info;volatilelong state;                  // TASK_RUNNING, TASK_INTERRUPTIBLE 等  ...conststructsched_classsched_class;// 调度类structsched_entityse;// 调度实体int on_rq;                             // 是否在运行队列上int prio;                              // 动态优先级  ...};

3.2.4. 调度实体 sched_entity

调度实体可以是一个进程或一个进程组,调度器依据其信息决定 CPU 时间分配。

structload_weight {unsignedlong weight;   // 负载权重  u32 inv_weight;         // weight 的倒数,避免除法运算};structsched_entity {structload_weightload;unsignedlong runnable_weight;structrb_noderun_node;// 红黑树节点structlist_headgroup_node;unsignedint on_rq;            // 是否在就绪队列上  u64 exec_start;                // 时间片开始时间  u64 sum_exec_runtime;          // 实际 CPU 占用时间  u64 vruntime;                  // 虚拟运行时间  ...};

3.2.5. 调度器 sched_class

structsched_class {conststructsched_class *next;// 调度类链表void (*enqueue_task) (struct rq *rq, struct task_struct *p, int flags);void (*dequeue_task) (struct rq *rq, struct task_struct *p, int flags);void (*check_preempt_curr)(struct rq *rq, struct task_struct *p, int flags);structtask_struct * (*pick_next_task)(structrq *rqstructtask_struct *prevstructrq_flags *rf);void (*put_prev_task)(struct rq *rq, struct task_struct *p);  ...};

内核调度类实例(优先级从高到低):

externconststructsched_classstop_sched_class;// 停止调度(关机等)externconststructsched_classdl_sched_class;// 截止期调度(硬实时)externconststructsched_classrt_sched_class;// 实时调度externconststructsched_classfair_sched_class;// 完全公平调度(默认)externconststructsched_classidle_sched_class;// 空闲调度

4. 参考

  • 《深入 Linux 内核架构》
  • 《Linux 内核设计与实现》
  • linux 调度子系统 8 - schedule 函数
  • 处理器调度 (RR, MLFQ 和 CFS;优先级翻转;多处理器调度)

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-04 11:17:59 HTTP/2.0 GET : https://f.mffb.com.cn/a/491083.html
  2. 运行时间 : 0.451327s [ 吞吐率:2.22req/s ] 内存消耗:4,655.56kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=267fdc5a82713857e3d5a44bc02683ca
  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.000646s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000639s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.011106s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.026123s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000858s ]
  6. SELECT * FROM `set` [ RunTime:0.027279s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000804s ]
  8. SELECT * FROM `article` WHERE `id` = 491083 LIMIT 1 [ RunTime:0.023611s ]
  9. UPDATE `article` SET `lasttime` = 1783135079 WHERE `id` = 491083 [ RunTime:0.011070s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.007421s ]
  11. SELECT * FROM `article` WHERE `id` < 491083 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.050402s ]
  12. SELECT * FROM `article` WHERE `id` > 491083 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.015838s ]
  13. SELECT * FROM `article` WHERE `id` < 491083 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.024831s ]
  14. SELECT * FROM `article` WHERE `id` < 491083 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.108117s ]
  15. SELECT * FROM `article` WHERE `id` < 491083 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.062896s ]
0.454954s