vagrant slow page load after 60 seconds from last request

二次信任 提交于 2021-02-07 10:45:26

问题


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:

  • it only happens to requests hitting the application (which is a laravel 5 application)
  • happens even if no queries are made to the db
  • if I die() at the very top of the application it is fast
  • static files are always served fast
  • serving the files from the native filesystem is fast
  • this sort of 60 seconds timer is reset even if requests are made to a different application (on the same server)

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...


回答1:


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'

See: Speed up sync latency between host and guest on Vagrant (NFS sync folders)



来源:https://stackoverflow.com/questions/29571079/vagrant-slow-page-load-after-60-seconds-from-last-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!