当前位置:首页>Linux>Linux Systemd 的解析与实践应用

Linux Systemd 的解析与实践应用

  • 2026-02-06 23:25:45
Linux Systemd 的解析与实践应用

点击上方“IT那活儿”公众号--专注于企业全栈运维技术分享,不管IT什么活儿,干就完了!!!

Systemd vs. 传统初始化系统对比

1.1 架构演进路线
SysVinit → Upstart → Systemd (现代初始化系统) 
1.2 核心能力对比
特性
传统系统 (SysVinit/Upstart)
Systemd
启动方式
串行启动 (依赖脚本顺序)
并行启动 (依赖关系图优化)
依赖管理
手动配置优先级 (chkconfig)
自动解析 (Requires/Wants)
资源控制
需外部工具 (ulimit)
原生cgroups集成
日志系统
分散式syslog
集中式journald
服务触发
事件驱动能力有限
套接字/路径/定时器按需启动
配置单元
Shell脚本 (/etc/init.d/)
声明式单元文件 (.service)
兼容性
兼容性高但扩展性差
功能强大但学习曲线陡峭

Systemd核心架构

2.1 主要功能
  • 服务管理
    控制服务的启动、停止、重启和状态监控。
  • 依赖管理
    定义服务之间的依赖关系,确保服务按正确的顺序启动。
  • 资源管理
    通过 cgroups 控制和管理进程的资源使用,如 CPU、内存和 I/O
  • 日志管理
    提供统一的日志记录系统,方便系统管理员查看和分析系统日志。
  • 定时任务
    支持基于时间的定时任务,类似于传统的 cron,但功能更强大。
  • 套接字激活
    允许按需启动服务,即当有连接请求时才启动服务,优化系统资源使用。
  • 路径监控
    根据文件系统路径的变化触发服务的启动。
  • 系统状态管理
    管理系统的运行级别(runlevels),如图形界面和命令行界面。
2.2 核心组件
  • systemd
    核心守护进程,负责启动和管理所有系统服务。
  • systemctl
    命令行工具,用于管理 Systemd 系统和服务。
  • journalctl
    命令行工具,用于查看和管理系统日志。
  • systemd-analyze
    工具,用于分析系统启动时间和性能。
  • systemd-tmpfiles
    工具,用于管理临时文件和目录。
2.3 单元类型体
单元类型
功能描述
.service
后台服务进程
.timer
时间触发任务
.socket
套接字监听
.path
文件系统路径监控
.slice
Cgroup资源分区控制
.target
逻辑组单元 (类似运行级别)
.mount
用于封装一个文件系统挂载点
.automount
用于封装一个文件系统自动挂载点
.swap
用于封装一个交换分区或交换文件
.scope
用于管理外部创建的进程

服务管理实战

3.1 服务生命周期控制
# 启停服务 systemctl start|stop|restart nginx.service # 开机管理 systemctl enable|disable nginx # 配置重载 systemctl daemon-reload
3.2 依赖关系配置示例
Requires:强依赖关系,被依赖服务启动失败时,当前服务也会启动失败。[Unit]Requires=serviceB.serviceWants:弱依赖关系,被依赖服务启动失败时,当前服务仍然可以启动。[Unit]Wants=serviceB.serviceAfter:当前服务在指定服务之后启动。[Unit]After=serviceB.serviceBefore:当前服务在指定服务之前启动。[Unit]Before=serviceB.service
3.3 条件启动机制
ConditionPathExists:路径(文件)存在时启动服务。[Unit]ConditionPathExists=/path/to/fileConditionPathIsDirectory:路径是目录时启动服务。[Unit]ConditionPathIsDirectory=/path/to/directoryConditionFileNotEmpty:文件不为空时启动服务。[Unit]ConditionFileNotEmpty=/path/to/file

资源控制 (cgroups集成)

4.1 CPU/内存限制示例
MemoryLimit:限制服务使用的内存。[Service]MemoryLimit=1GCPUShares:设置服务的 CPU 权重。[Service]CPUShares=100LimitNOFILE:限制服务打开的文件描述符数量。[Service]LimitNOFILE=65536
4.2 cgroups高级控制参
分类
参数
作用域
单位/取值
文档出处
关键功能描述
1. CPU资源控制
CPUWeight=
Slice/Service
1-10000
systemd.resource-control §CPU Weight
CPU时间片相对权重
StartupCPUWeight=
Service
1-10000
同上§StartupCPUWeight
启动期临时CPU权重
CPUQuota=
Slice/Service
百分比(150%)
同上§CPU Quota
硬性CPU时间配额上限
CPUAffinity=
Service
数字编号或区间
systemd.exec §CPU Affinity
绑定到指定CPU核心
AllowedCPUs=
Service
数字编号或掩码
同上§AllowedCPUs
白名单方式限制可用CPU
2. 内存与交换空间
MemoryMax=
Slice/Service
K/M/G/T
systemd.resource-control §Memory Max
物理内存硬限制(触发OOM
MemoryHigh=
Slice/Service
K/M/G/T
同上§Memory High
内存压力软限制(开始回收)
MemorySwapMax=
Slice/Service
K/M/G/T
同上§Memory Swap Max
总虚拟内存(物理+swap)限制
MemoryZSwapMax=
Slice/Service
K/M/G/T
同上§Memory ZSwap Max
zswap压缩缓存最大使用量(v254+
3. 块设备I/O调度
IOWeight=
Slice/Service
1-10000
systemd.resource-control §IO Weight
块设备I/O优先级权重
StartupIOWeight=
Service
1-10000
同上§StartupIOWeight
启动期临时I/O权重
IODeviceWeight=
Slice/Service
设备路径+权重
同上§IODeviceWeight
指定设备的权重比例
IOReadBandwidthMax=
Slice/Service
设备路径+带宽
同上§IO Bandwidth Max
设备读取带宽上限
IOWriteBandwidthMax=
Slice/Service
设备路径+带宽
同上
设备写入带宽上限
IOReadIOPSMax=
Slice/Service
设备路径+IOPS
同上§IOPS Max
每秒最大读取IO操作数
IOWriteIOPSMax=
Slice/Service
设备路径+IOPS
同上
每秒最大写入IO操作数
4. 进程与线程控制
TasksMax=
Service
数字
systemd.resource-control §Tasks Max
最大并发进程+线程数
ThreadsMax=
Service
数字
systemd.exec §Threads Max
单个进程的最大线程数
LimitNPROC=
Service
数字
systemd.exec §LimitNPROC
用户级最大进程数(传统ulimit
LimitMEMLOCK=
Service
字节
同上§LimitMEMLOCK
允许锁定的内存量
5. 实时进程调度
CPUSchedulingPolicy=
Service
fifo/rr
systemd.exec §CPU Scheduling
实时进程的调度策略
CPUSchedulingPriority=
Service
1-99
同上
实时进程优先级
Nice=
Service
-39
同上§Nice
普通进程的静态优先级
6. 网络带宽控制(需内核cgroup net_cls支持)
NetClass=
Service
major:minor
systemd.resource-control §NetClass
cgroup网络分类标识

日志管理系统 (journald)

常用诊断命令:
  • journalctl -eu sshd
    查看sshd服务日志,并直接跳转到日志末尾。
  • journalctl -xeu sshd
    查看sshd服务日志,并直接跳转到日志末尾,同时打印可用的服务描述。
  • journalctl -u sshd -n 10
    查看sshd服务日志,并只打印前10行。
  • journalctl -u sshd -f
    以实时更新的方式查看sshd服务日志。
  • journalctl --file ${FILENAME}
    journal文件内容,journal文件一般存放在/run/log/journal/目录下。
# 容器化环境专用journalctl –u tomcat.service CONTAINER_ID=$(docker inspect -f '{{.Id}}' tomcat)# 查看完整日志流journalctl -u tomcat.service –f# 按日志级别过滤(DEBUG=7, INFO=6, ERROR=3)journalctl -u tomcat.service --priority 3..6# 查看最新 100 条日志journalctl -u tomcat.service --lines=100# JSON 格式输出(用于数据管道)journalctl -u tomcat.service -o json-pretty# 组合查询(时间 + 进程)journalctl --since "2023-08-01 00:00:00" --until "2023-08-02 12:00:00" –u tomcat.service# 关键词搜索journalctl -u tomcat.service --grep=“OutOfMemoryError”

高级功能应用

6.1 套接字激活示例
# /home/wang6237/.config/systemd/user/mysqld.socket[Unit]Description=MySQL Socket ActivationPartOf=mysqld.service可选,关联到服务单元[Socket]监听 Unix 套接字(推荐)ListenStream=/home/wang6237/app/mysqld/mysql.sock或监听 TCP 端口(如 3306#ListenStream=3306设置套接字权限(Unix 套接字需要)SocketUser=wang6237SocketGroup=wang6237SocketMode=0660关联的服务名称(默认与 socket 同名,这里显式指定)Service=mysqld.service[Install]WantedBy=sockets.target
# /home/wang6237/.config/systemd/user/mysqld.service[Unit]服务描述Description=MariaDB 11.4.5 database server相关文档资源(man手册和网页文档)Documentation=man:mariadbd(8)Documentation=https://mariadb.com/kb/en/library/systemd/定义启动顺序:在网络服务启动后启动After=network.target强依赖的关联服务(必须成功启动 mysqld.socket)Requires=mysqld.socket[Install]定义在 multi-user 模式时启用该服务(常规多用户运行级别)WantedBy=multi-user.target[Service]服务类型为 notify(服务会发信号通知systemd其状态)Type=notify
隔离配置:
禁用网络命名空间隔离(允许访问主机网络)PrivateNetwork=false禁用设备节点隔离(允许访问系统设备)PrivateDevices=false严格保护系统目录(/usr/, /boot/ 等只读)ProtectSystem=full禁止访问 /home/, /root/ 和 /run/user/ProtectHome=true仅在启动阶段检查权限(后续操作不以root运行)PermissionsStartOnly=true文件系统权限 ------------------------------------------------------------指定可读写目录(数据存储路径)ReadWritePaths=-/home/wang6237/app/mysqld/data文件创建时的权限掩码(属主和组可读写,其他无权限)UMask=007进程参数 ----------------------------------------------------------------ExecStart=/home/wang6237/app/mysqld/bin/mariadbd --basedir=/home/wang6237/app/mysqld --datadir=/home/wang6237/app/mysqld/data --plugin-dir=/home/wang6237/app/mysqld/lib/plugin --log-error=/home/wang6237/app/mysqld/logs/error.log --pid-file=/home/wang6237/app/mysqld/data/wang6237-ubuntu.pid --socket=/home/wang6237/app/mysqld/mysql.sock--port=3306
日志配置:
标准输入通过套接字传递StandardInput=socket标准输出记录到systemd日志StandardOutput=journal标准错误记录到systemd日志StandardError=journal辅助命令 ----------------------------------------------------------------启动后清理环境变量ExecStartPost=/bin/sh -c "systemctl --user unset-environment _WSREP_START_POSITION"信号处理 ----------------------------------------------------------------首先发送终止信号(允许优雅退出)KillSignal=SIGTERM不强制发送SIGKILLSendSIGKILL=no停止超时时间(15分钟,处理大事务时可能需要较长时间)TimeoutStopSec=900
重启策略:
仅在异常退出时自动重启Restart=on-abort重启前等待时间RestartSec=5s
资源限制:
禁用临时目录隔离(使用系统/tmp)PrivateTmp=false最大任务数(相对系统总限制的百分比)TasksMax=99%最大打开文件描述符数(默认1024,数据库服务需要更高)LimitNOFILE=32768
运行环境:
设置时区Environment="TZ=Asia/Shanghai"
超时设置:
启动超时时间(15分钟,等待数据库初始化)
▶ 机制:由systemd监听3306端口,收到请求时才启动mysql。
6.2 路径监控配置
# file-monitor.path [Path] PathModified=/data/upload/ # 监控目录修改 Unit=process-files.service # 触发服务 # process-files.service [Service] Type=oneshot ExecStart=/opt/scripts/process.sh
▶ 支持事件类型:PathChanged/PathMovedTo/DirectoryNotEmpty
6.3 Systemd Timer替代Cron
Crontab痛点解决
[Unit]Description=Daily Backup Timer # 定时器描述Requires=daily-backup.service # 依赖的 Service[Timer]OnCalendar=--* 02:00:00 # 每天凌晨2点执行AccuracySec=1s # 时间精度(秒级)Persistent=true # 若错过时间,启动后立即补执行Unit=daily-backup.service # 关联的 Service[Install]WantedBy=timers.target # 系统启动时激活定时器
[Unit]Description=Daily Database Backup # 任务描述After=network.target # 确保网络可用后执行[Service]Type=oneshot # 单次任务(非守护进程)User=appuser # 以非特权用户运行Group=appgroupEnvironment="PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/bin" # 显式定义环境变量Environment="DB_HOST=localhost" # 自定义环境变量ExecStart=/opt/scripts/backup.sh # 必须使用绝对路径ExecStartPost=/usr/bin/logger "Backup completed" # 任务完成后记录日志Restart=on-failure # 失败时自动重试RestartSec=30s # 重试间隔StandardOutput=journal # 输出到 systemd 日志StandardError=journal # 错误输出到 systemd 日志[Install]WantedBy=multi-user.target

实践场景

7.1 运维最佳实践
  • 服务隔离
    使用.slice划分资源域 (如 db.slice/app.slice) ;
  • 启动加速
    并行启动无关服务 + 禁用延迟启动;
  • 安全加固
    Service单元中配置`ProtectSystem=strict` ;
  • 故障自愈
    `Restart=on-failure` + `StartLimitIntervalSec=60` 。
7.2 常用参数
[Unit]Description=Resource Constrained ServiceAfter=network.target[Service]Type=simpleExecStart=/usr/bin/your-service# CPU 限制CPUWeight=50# 相对权重 (1-10000, 默认100)CPUQuota=150# 最大 CPU 时间份额AllowedCPUs=0-2# CPU 核心限定 (NUMA 优化)# 内存限制MemoryHigh=512# 软性内存限制 (系统主动回收)MemoryMax=768# 硬性内存限制 (单独使用,会使用swap。当swap不够时,会触发oom-kill)MemorySwapMax=128# Swap 用量上限(触发 OOM 终结)MemoryZswapMax=64# 压缩内存上限# I/O 流量限制IOWeight=500# 块设备权重 (1-10000)IODeviceWeight=/dev/nvme0n1 200# 指定设备权重IOReadBandwidthMax=/dev/nvme0n1 50MIOWriteBandwidthMax=/dev/nvme0n1 30M# 高级限制层AllowedMemoryNodes=0-1# NUMA 内存节点限定AllowedCPUMEM=0# CPU 内存强关联DeviceAllow=/dev/nvme0n1 rw # 设备访问白名单DevicePolicy=closed# 安全沙盒ProtectSystem=strictPrivateTmp=yesRestrictAddressFamilies=AF_INET AF_INET6[Install]WantedBy=multi-user.target
规避参数警告:
  • 过时参数 (cgroups v1 时代)
    - CPUShares → 改用 CPUWeight
    - MemoryLimit → 改用 MemoryMax
    - BlockIO* → 改用 IO* 前缀参数
    - TasksMax →  [Service] 中使用,但建议配置为数值而非百分比
动态调优技巧:
  • 实时调整
    systemctl set-property service.service CPUQuota=200%;
  • 压力测试
    stress-ng --vm 2 --io 4 --cpu 8 --timeout 60s;
  • 监控调试
    systemd-cgtop -n -1 -m。
版本适配说明: 
  • 资源控制参数需Linux 4.15+内核支持;
  • cgroups v2特性需Systemd 247+版本。
END

本文作者:王玉坤(上海新炬中北团队)

本文来源:“IT那活儿”公众号

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-07 09:03:34 HTTP/2.0 GET : https://f.mffb.com.cn/a/474044.html
  2. 运行时间 : 0.220434s [ 吞吐率:4.54req/s ] 内存消耗:4,408.71kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=532afae3a1809c6ca9a41037fde96e36
  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.001121s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001572s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000821s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000715s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001499s ]
  6. SELECT * FROM `set` [ RunTime:0.000579s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001591s ]
  8. SELECT * FROM `article` WHERE `id` = 474044 LIMIT 1 [ RunTime:0.001129s ]
  9. UPDATE `article` SET `lasttime` = 1770426215 WHERE `id` = 474044 [ RunTime:0.023217s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.008280s ]
  11. SELECT * FROM `article` WHERE `id` < 474044 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001326s ]
  12. SELECT * FROM `article` WHERE `id` > 474044 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.002494s ]
  13. SELECT * FROM `article` WHERE `id` < 474044 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.002230s ]
  14. SELECT * FROM `article` WHERE `id` < 474044 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001725s ]
  15. SELECT * FROM `article` WHERE `id` < 474044 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001615s ]
0.224304s