问题标签 [xhprof]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
970 浏览

php - 确定 php 脚本使用了多少资源(cpu 百分比和内存)

我目前正在使用由tideways.ioxhprof分叉的库来分析执行。从, 我可以得到, ,和. 我正在尝试对 symfony 控制台进行基准测试 - 所以我添加了它和它的.myscript.phpxhprofwalltimecputimememoryusagepeakmemoryusageTIDEWAYS_ENABLE()ConsoleCommandEventTIDEWAYS_DISABLEConsoleTerminateEvent

问题:

  1. 我如何确定是否myscript.php消耗了多少百分比的cpu?我可以像在 serverfault 上cpuusage = cputime / realtime所说的那样计算百分比吗?
  2. 给定一个memoryusage (mu)peakmemoryusage (pmu)来自xhprof探查器,我如何转换或计算它的ram使用量?(top结果显示远高于memoryusage但不知何故接近peakmemoryusage价值,所以我可以说ram使用是价值peakmemoryusage吗?

笔记:

0 投票
1 回答
505 浏览

php - exited on signal 11 xhprof

I have a big problem. I installed php5 extension XHprof on server (Ubuntu 14.04), and when I try to use it I have the 502 Bad Gateway. Logs of nginx are empty, and in php-fpm log I have this:

In my script I wrote this:

If I comment line with xhprof_enable(), it prints OK! and works correctly. So extension xhprof loaded and function xhprof_enable() exists (available). And phpinfo() show that xhprof exists. What can I do? It is very important.

Sorry for my English :) I know it a bit.

0 投票
0 回答
48 浏览

php - API 端的 XHProf

我们有一个项目与 SOAP-client 〉 SOAP-server 交互。双方都是我们拥有的基于 ZF2 的产品。

项目图

在 Zend\Soap\Client::__call 之前,我们成功地分析了 API 客户端。在大多数情况下,SOAP 请求是“等待时间”的 90%。因此,现在我们正在寻找一种方法来找出花费 0.0001 秒的 SQL 操作如何在soapUI 和 SOAP 客户端上变成 1 秒响应。

换句话说,www.apiClient.tld/orderList?debug如果 SOAP-Server 请求看起来像 ,如何获取我们在 SOAP-Client 端拥有的 XHProf 数据报www.apiServer.tld/api/order/wsdl

你的项目做了什么来获取 API 分析数据,你选择什么来分析 SOAP API 服务器端?

0 投票
1 回答
898 浏览

php - Xhprof / xhgui : xhgui - 要插入的文档包含无效键:键不能包含“。”

我正在尝试使用 Xhprof 设置 Xhgui。我遵循了 github 说明(https://github.com/perftools/xhgui),但此错误消息不断出现在错误日志中:

“xhgui - 要插入的文档包含无效键:键不能包含“。”:“main()==>load...”

看起来 mongoDB 不能在键中使用点,但 Xhgui 正在尝试这样做。

有没有办法在 mongoDB 中禁用这个限制?或者在 Xhgui 中修复这个错误?

0 投票
1 回答
170 浏览

php - 如何安装 YaxGUI 以在 Ubuntu 中使用潮流?

我刚刚安装了tideways(来自xhprof 的fork),发现了这个GUI YaxGUI,安装步骤对我来说还不够清楚。

安装您最喜欢的 PHP 和 Web 服务器组合
安装 MySQL 服务器
将项目克隆到某个文件夹
映射子文件夹 xhprof_html 以通过 HTTP 访问
移动 xhprof_lib/config.sample.php 到 xhprof_lib/config.php
编辑 xhprof_lib/config.php
更新SQL 服务器配置
更新服务的 URL(应该通过 HTTP 指向 xhprof_html)
更新 dot_binary 配置 - 否则没有调用图!
更新 controlIPs 变量以启用访问。
对于开发机器,您可以将其设置为 false 以禁用 IP 检查。
导入数据库模式(它只是 1 个表)
请参阅 xhprof_runs.php 中的 SQL
添加 PHP 配置以启用分析
如果使用 Apache,您可以编辑虚拟主机配置
添加 php_admin_value auto_prepend_file "/path/to/xhprof/external/header.php"
访问http://your-server/xhprof/xhprof_html/并成为惊讶!
要获得在那里显示的探查器信息,请使用 GET 变量 _profile=1 访问您的页面。
例如http://localhost/?_profile=1

我停在了这一点上:

导入数据库模式(它只是 1 个表)

而且不知道接下来要做什么。

0 投票
0 回答
203 浏览

php - PHP worker 中的内存泄漏

我在主管下有 PHP 工人。

而且我有内存泄漏。我使用“xhprof”来添加一些信息。但我仍然找不到任何东西。

如果我重新启动工人 - 一切都很好,但问题又开始了:(

关于如何在“xhprof”中找到任何信息的任何想法?

0 投票
1 回答
5521 浏览

php - PHP Fatal error: Unknown: Failed opening required '/home/user/pathto/header.php' after adding it as auto_prepend_file

My goal is to configure php profiling for local development website in Kubuntu 16.04.

Installed tideways according to docs and checked it's installed correctly with:

Created header.php with following contents

Added reference to it to php.ini

Restarted apache2

And getting the below errors in apache error log:

[Sat Jan 27 17:54:24.233604 2018] [:error] [pid 15976] [client 127.0.0.1:42054] PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 [Sat Jan 27 17:54:24.233653 2018] [:error] [pid 15976] [client 127.0.0.1:42054] PHP Fatal error: Unknown: Failed opening required '/home/user/pathto/header.php' (include_path='.:/usr/share/php') in Unknown on line 0

Tried adding directive

to Directory block of the website in apache2.conf, but the same error pops.

What's wrong? What permissions are wrong? Regards.

0 投票
1 回答
724 浏览

php - 如何读取 .xhprof 文件?

我有从 XHProf 和 UProfiler 生成的 .xhprof 文件。

尝试使用 SugarCrm XHProf 查看器和 UProfiler 查看器,但它们都不会读取 .xhprof 文件。

我是否必须进行任何转换才能阅读此报告?

0 投票
2 回答
295 浏览

php - XHProf 分析 - 如何获取分层配置文件?

当我点击我的 Drupal 应用程序的搜索 URL 时,我可以看到 CPU 使用率很高。我在 PHP5.6 上启用了 XHProf 模块和 UProfiler 扩展来查找罪魁祸首函数。

但是我得到的报告只给了我需要 cpu 时间的第一级功能。

在此处输入图像描述

但是,函数名称上没有超链接可以单击它并向下钻取。关于可以做些什么来深入研究的任何建议?

基本上它只显示平面配置文件,我如何获得分层配置文件视图?

0 投票
0 回答
97 浏览

php - XHProf/XHGui 导入配置文件

external/import.php 脚本似乎对我不起作用。我正在使用 Docker 安装以及本地 webapp。我尝试使用通过分析我的 Symfony-Webapp 并将 XHProf 输出编码为 Json 创建的 Json 文件。Json 文件看起来像这样:

文件本身有大约 6.000 行。当我尝试使用脚本导入它时,什么都没有发生。大约一个小时后,我中止了这个过程,并用一个包含大约 20 行的 Json 文件重试了它。然后我再次执行命令。这一次,它在大约 5 分钟后结束了该过程,但数据库没有任何变化,Web 界面也没有变化。

在搜索了一整天的任何文档之后,我唯一的结果似乎已经过时了,因为它们包含 external/headers.php 文件,在当前主文件中找不到该文件。有没有人知道如何导入这些配置文件?我是否错过了一些我应该包含的数据?