0

Been trying to understand the overall performance of our application by comparing the benchmark we get from our dev environment and our prod environment.

Interestingly, in our dev environment, which is our local machine, we get application run time as fast as 98ms.

The same application runs on avg at 400ms in our production server, which is a VPS with CentOS 5.8 running.

I'm assuming that this increase must be because of network connection lag between web server and database server, since we didn't have this gap in the dev environment, everything is local.

We're using Doctrine 2.0 as an ORM for our application, we haven't really gotten into optimizing it by caching.

Is there a way to optimize this lag time? Or am I completely wrong about the case?

4

1 回答 1

0

衡量实际使用的数据库和查询时间的最佳选择是设置数据库分析器。

你可以阅读:Profiling Doctrine 2 with Zend Framework

需要注意的是,运行分析器仅应用于测试。您不应该一直运行它,尤其是在您的生产服务器容量很大的情况下。它会增加一些处理时间,但会为您提供有关查询和连接时间的更多信息。

您假设它是盒子之间的延迟可能是正确的,这将为您验证。

于 2012-10-10T21:36:15.830 回答