Apache deflate和渐进式HTTP响应

我在电子商务网站上工作,我们的生产服务器和测试之间的重要性能差异很大 服务器</ strong>。</ p>

两者都是运行在带有WampServer 2.5(Apache 2.4.9 / PHP 5.5.12)的Windows Server 2008 R2 64位上的VM。</ p>

(注意:我知道WampServer不适合生产用途,但此时它仍然是我们的最佳解决方案,因为我们高度依赖Windows环境来处理我们的数据库和其他东西。我们尝试优化Apache和放大器 ;用于生产的PHP配置,我们在我们的测试服务器上复制了conf,因此我们在两台机器上都有相同的环境。)</ em> </ p>

从那里一切运行正常,直到 今天。 当我们发现两台服务器之间存在重大差异时,我们正在尝试改进Apache文件压缩配置(在图像上禁用它,启用html文件等)。 </ p>

在同一页面上(针对测试需求:包含大量内容和图像的大型产品列表),相同的请求,相同的用户,相同的浏览器:</ p>


  • 生产服务器</ strong>似乎在发送之前“准备”整个文档。 在几秒钟内,我要等待并观看一个空白的浏览器,然后立即显示。 在Chrome开发者工具中,等待时间约为7秒</ strong>,接收时间约为50毫秒</ strong>。</ p> </ li>

  • 测试服务器</ strong>似乎恰恰相反:在几秒钟内没有空白页面,标题显示非常快,其余内容一步一步显示,而我已经可以浏览页面了。 等待时间约为200毫秒</ strong>和接收时间约为11秒</ strong>。</ p> </ li>
    </ ul>

    我的 我自己的开发机器,当我切换Apache的mod_deflate配置时,我可以观察到这两种情况。 </ p>

    因此,经过多次尝试,我们只是在生产服务器上禁用了mod_deflate,然后在测试服务器上禁用了mod_deflate。 两者都具有完全相同的配置,但仍然存在这种巨大差异。

    我也查看了php.ini文件,考虑了缓存问题或类似的东西,但同样处理:两个配置文件都匹配,但两个服务器的工作方式仍然不同。</ p>

    我们 花了好几个小时在网上搜索答案,但似乎没有任何工作...... </ p>

    请有人帮助我们吗?</ p>
    </ div>

展开原文

原文

I work on an e-commerce website and we have important performances difference between our production server and our test server.

Both are VM running on Windows Server 2008 R2 64bits with WampServer 2.5 (Apache 2.4.9 / PHP 5.5.12).

(Note : I know that WampServer is not for production uses, but at this time it's still the best solution for us as we highly depend on Windows environment for our databases and other stuff. We tried to optimize Apache & PHP configuration for production, and we replicated that conf on our test server, so we have the same environment on both machines.)

Everything was running okay from there, until today. We were attempting to improve Apache files compression configuration (disabling it on images, enabling on html files, etc) when we noticed a major difference between the two servers.

On the same page (for test needs : an huge products list with a lot of content and images to display), same request, same user, same browser :

  • The production server seems to "prepare" the whole document before sending it. During several seconds I've to wait and watch a blank browser, then all shows up instantly. In Chrome Dev Tools, Waiting time is around 7 sec and Receiving time around 50 msec.

  • The test server seems to do just the opposite : no blank page during seconds, the header is displaying very quickly and the rest of the content comes step by step while I can already browse the page. Waiting time is around 200 msec and Receiving time around 11 sec.

On my own development machine, I can observe both situations when I toggle Apache's configuration for mod_deflate.

So after several attempts, we just disabled the mod_deflate on the production server, and then on the test server. Both have the exact same configuration, and still there is this big difference. I also looked on php.ini files, thinking about cache issues or something like that, but same deal here : both configuration files are matching but the two servers are still working differently.

We spent hours searching answers on the web, but nothing seems to work...

Please, can somebody help us on that ?

dongwende1984
dongwende1984 如果它们是不同的系统,它们可能会运行不同的东西。即使在其他服务器上没有运行“昂贵”的东西,也有可能正在运行导致您看到的行为。
大约 6 年之前 回复
douyiji3919
douyiji3919 不,每个人都在他自己的物理服务器上。你认为这可能与我们的问题有关吗?
大约 6 年之前 回复
duanbei7005
duanbei7005 它们是否位于不同VM中的同一物理服务器上?
大约 6 年之前 回复
douchun6221
douchun6221 在两台服务器上:只禁用output_buffering和output_handler;implicit_flush设置为Off。
大约 6 年之前 回复
douhengdao4499
douhengdao4499 您的输出缓冲,输出处理程序和隐式刷新的PHP设置是什么?
大约 6 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐