开发者社区> 问答> 正文

strace 分析 phpfpm CPU偏高

阿里 centos,php7

strace分析php-fpm 发现每一步时间都偏长

框架不同,一个Yii一个Tp5,是框架问题么?

问题机器,cpu偏高,单个phpfpm进程达5%

11:03:44.762409 times({tms_utime=471134, tms_stime=33854, tms_cutime=0, tms_cstime=0}) = 712987044 <0.000036>
11:03:44.762504 read(3, "\1\1\0\1\0\10\0\0", 8) = 8 <0.000037>
11:03:44.762596 read(3, "\0\1\0\0\0\0\0\0", 8) = 8 <0.000035>
11:03:44.762685 read(3, "\1\4\0\1\5\0\0\0", 8) = 8 <0.000044>
11:03:44.764982 open("/data/www/myyiiproject/vendor/yiisoft/yii2/Yii.php", O_RDONLY) = 4 <0.000044>
11:03:44.765083 fstat(4, {st_mode=S_IFREG|0644, st_size=682, ...}) = 0 <0.000035>
11:03:44.765173 fstat(4, {st_mode=S_IFREG|0644, st_size=682, ...}) = 0 <0.000034>
11:03:44.765260 fstat(4, {st_mode=S_IFREG|0644, st_size=682, ...}) = 0 <0.000035>
11:03:44.765348 mmap(NULL, 682, PROT_READ, MAP_SHARED, 4, 0) = 0x7f9390298000 <0.000045>
11:03:44.765528 munmap(0x7f9390298000, 682) = 0 <0.000038>
正常机器,不到1%的cpu

22:59:33.460625 poll([{fd=4, events=POLLIN}], 1, 5000) = 1 ([{fd=4, revents=POLLIN}]) <0.000023>
22:59:33.460743 times({tms_utime=2048, tms_stime=723, tms_cutime=0, tms_cstime=0}) = 1071255298 <0.000019>
22:59:33.460794 read(4, "\1\1\0\1\0\10\0\0", 8) = 8 <0.000019>
22:59:33.460843 read(4, "\0\1\0\0\0\0\0\0", 8) = 8 <0.000018>
22:59:33.460890 read(4, "\1\4\0\1\3\350\0\0", 8) = 8 <0.000022>
22:59:33.462372 open("/data/www/mytpproject/thinkphp/start.php", O_RDONLY) = 5 <0.000029>
22:59:33.462438 fstat(5, {st_mode=S_IFREG|0644, st_size=745, ...}) = 0 <0.000018>
22:59:33.462490 fstat(5, {st_mode=S_IFREG|0644, st_size=745, ...}) = 0 <0.000018>
22:59:33.462538 fstat(5, {st_mode=S_IFREG|0644, st_size=745, ...}) = 0 <0.000017>
22:59:33.462598 mmap(NULL, 745, PROT_READ, MAP_SHARED, 5, 0) = 0x7f14035b7000 <0.000021>
22:59:33.462659 munmap(0x7f14035b7000, 745) = 0 <0.000020>

展开
收起
因为相信,所以看见。 2020-05-23 11:54:23 512 0
1 条回答
写回答
取消 提交回答
  • 由于该问题机器承担了App下载任务,程序在App下载量大的时候,IO高,导致php程序慢,CPU也高了

    2021-02-23 01:49:33
    赞同 展开评论 打赏
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
RDS SQL Server CPU高使用率性能优化 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载

相关实验场景

更多