php profiling:什么结果是正常的?

发布于 2024-08-09 04:55:17 字数 308 浏览 3 评论 0原文

使用我的计算机(Windows 7、Amd Athlon X2、1 GB RAM)作为测试服务器。

我的应用程序基于 Zend Framework。它使用MySQL和Zend_Translation,以及Memcached作为缓存。

我使用简单的 microtime() 获取 PHP 应用程序的执行时间: 执行时间0.086215972900391 (当数据库和翻译数据被缓存时)

我想知道我的结果是不好、非常糟糕还是正常。怎么知道呢?我可以在我的计算机上运行什么来比较?或者也许还有其他方法?或者也许我不应该打扰,直到我在更“真实”的服务器上运行它?

As testing server, my computer (Windows 7, Amd Athlon X2, 1 GB RAM) is used.

My application is based on Zend Framework. It uses MySQL and Zend_Translation, and Memcached as cache.

I'm getting execution time of my PHP application with simple microtime():
Execution time 0.086215972900391
(when db and translation data is cached)

I want to know if my results are bad, very bad or maybe normal. How to know it? What can I run on my computer to compare with? Or maybe there're another ways? Or maybe I shouldn't bother until I run it on more 'real' server?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

小兔几 2024-08-16 04:55:17

这是一个基本问题,因为……

  • 所有基准都是不同的。
  • 所有的应用程序都是不同的。

就我个人而言,我认为您测量的“执行时间”非常好。 :) 不过,您可以使用 Apache Bench (ab) 或 jmeter。因此,ab 和 jmeter 的想法是进行负载测试,这是为了确定应用程序在多个客户端(用户)使用时的执行情况。

此外,对于一个很好的基准,它有助于提供尽可能多的细节。这将包括您的硬件设置(CPU、RAM、HDD 等),也包括您的应用程序。否则很难判断其效率如何。

无论如何,底线 0.08 对我来说听起来不错! :-)

This is a fundamental question because...

  • All benchmarks are different.
  • All applications are different.

Personally, I think your measured "execution time" is more than alright. :) You could however do slightly more comprehensive testing using Apache Bench (ab) or jmeter. So the idea with ab and jmeter are to do load tests, this is to determine how your application performs when multiple clients (users) use it.

Also, for a great benchmark, it helps to provide as many details as possible. That would include your hardware setup (CPU, RAM, HDD, etc.) but your application as well. Otherwise it's hard to judge how efficient this is.

Anyway, the bottom line, 0.08 sounds good to me! :-)

月下客 2024-08-16 04:55:17

结果有多好取决于您想要实现的目标。计算一下您可以在单个服务器上处理多少用户,并将其与您计划/希望为您的网站实现的用户数量进行比较。

从业务角度更进一步,使用这些数字来计算您的预期服务器成本与您预期的收入(基于每个用户的平均收入)。

How good the results are depend on what you're trying to achieve. Do the math to determine how many users you can handle on a single server, and compare that to how many users you plan to/hope to achieve for your website.

Taking it a step further in a business standpoint, use those numbers to calculate your expected server costs vs. what you expect to make in revenue (based upon avg. earnings per user).

烈酒灼喉 2024-08-16 04:55:17

尝试使用 httperf 计算出您的设置可以处理多少个同时点击。

此外,还有一个 来自 Peepcode 的精彩截屏,详细解释了 Httperf 的基准测试。

Try using httperf to work out how many simultaneous hits your set up can handle.

Also, there's a nice screencast from Peepcode explaining benchmarking with Httperf in detail.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文