从上次请求开始60秒后,游民页面加载缓慢 [英] vagrant slow page load after 60 seconds from last request

查看:52
本文介绍了从上次请求开始60秒后,游民页面加载缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果自上次页面加载起经过60秒以上,则运行经典LAMP堆栈(ubuntu 14,php 5.5.9)的My Vagrant盒将缓慢地提供页面(〜5.3/5.5秒).正常"页面加载(通过60秒限制之前)约为0.2秒.通过NFS从主机系统共享应用程序文件.

My Vagrant box running a classic LAMP stack (ubuntu 14, php 5.5.9) serves pages slowly (~ 5.3/5.5 secs) if more than 60 seconds passed since last page load. The "normal" page load (before passing the 60 secs limit) is ~0.2 sec. The application files are shared from the host system via NFS.

到目前为止我调试过的东西:

What I've debugged so far:

  • 它仅发生在点击应用程序的请求上(这是一个laravel 5应用程序)
  • 即使没有对数据库进行查询,也会发生
  • 如果我在应用程序的最顶部死去(),那就快了
  • 始终可以快速提供静态文件
  • 从本机文件系统提供文件很快
  • 即使对其他应用程序(在同一服务器上)进行了请求,这种60秒计时器也会重置

关于这可能是什么的任何提示?我认为这显然与需要在NFS上访问的大量文件有关,但是60秒钟的事情对我来说似乎很奇怪...

Any hints on what could be causing this ? I think it is clearly related to the large number of files that need to be accessed on NFS, but the 60 seconds thing seems weird to me...

推荐答案

该问题与NFS属性缓存(默认情况下持续60秒)有关,并通过设置以下安装选项解决了该问题:

The problem was related to NFS attribute caching (that lasts 60 seconds by default) and solved it by setting the following mount options:

'nolock,vers=3,udp,noatime,actimeo=1'

请参阅:加快主机与主机之间的同步延迟Vagrant上的来宾(NFS同步文件夹)

这篇关于从上次请求开始60秒后,游民页面加载缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆