简体   繁体   English

跟踪PHP性能问题

[英]Tracking down a PHP performance issue

I have a PHP script which runs fine on a Raspberry Pi PHP 5.4.4, but when I run the same script on a Cubieboard2 ( about twice the power of the Pi) PHP 5.4.6 I get a long delay. 我有一个可以在Raspberry Pi PHP 5.4.4上正常运行的PHP脚本,但是当我在Cubieboard2(大约是Pi的功能的两倍)上运行相同的脚本时,PHP 5.4.6会出现很长的延迟。 In both cases there is no caching of the PHP as far as I know. 据我所知,在两种情况下都没有缓存PHP。 The problem seems to be with a file_get_contents request which is retrieving some xml from the web. 问题似乎与file_get_contents请求有关,该请求正在从Web检索一些xml。 Although if I enter the same information in a browser in the same system it comes back quickly enough. 尽管如果我在同一系统的浏览器中输入相同的信息,它很快就会返回。

There are no related entries in /var/log/apache2/error.log /var/log/apache2/error.log中没有相关条目

Any ideas of how to track the problem down. 有关如何跟踪问题的任何想法。

Thanks 谢谢

Check if both systems have the same settings for ipv6. 检查两个系统的ipv6设置是否相同。 Some distributions have ipv6 enabled and tries that before ipv4. 一些发行版启用了ipv6,并在ipv4之前尝试使用该版本。

Could be a reverse DNS lookup with a invalid resolve setup. 可能是带有无效解析设置的反向DNS查找。 Check if apache(or your webserver) has set reverse dns for logging. 检查apache(或您的Web服务器)是否设置了反向dns进行日志记录。

Check https://serverfault.com/questions/100225/apache-httpd-wont-stop-doing-reverse-dns-requests-for-clients-ips or just google it 检查https://serverfault.com/questions/100225/apache-httpd-wont-stop-doing-reverse-dns-requests-for-clients-ips或只是在Google上搜索

And check if you can ping www.google.at from a shell. 并检查是否可以从Shell ping www.google.at

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM