Virtualbox、Vagrant 和 Cowboy 的 Sendfile 错误
Sendfile bug with Virtualbox, Vagrant and Cowboy
我将 Vagrant 与 Virtualbox 提供程序一起用于 运行 一个 Elixir/Phoenix 项目,但我正在 运行 解决这个问题 (https://www.getconvey.com/devblog/virtualbox-still-hates-sendfile/),是吗一种在 Cowboy Web 服务器中禁用 sendfile 的方法?
我很高兴地报告我已经在我自己的安装中解决了这个问题,详情如下:
解决发送文件问题的另一种方法是对共享目录使用 NFS。这是我使用的 Vagrant 配置,运行良好:
config.vm.synced_folder "/host/path/", "/guest/path/", type: "nfs", :mount_options => ['nolock,vers=3,udp,noatime,actimeo=1']
太棒了!然而,一个问题已解决,Phoenix 用于实时重新加载检测的 inotify 功能不适用于 NFS...
要解决该问题,请安装此 vagrant 插件:https://github.com/mhallin/vagrant-notify-forwarder
在这两个和重新加载来宾机器之后,实时重新加载完美无缺
另请注意,如果 Cowboy 能够禁用 sendfile,我猜就没有必要使用此解决方法。该修复的相关问题是:https://github.com/ninenines/cowboy/issues/812
我将 Vagrant 与 Virtualbox 提供程序一起用于 运行 一个 Elixir/Phoenix 项目,但我正在 运行 解决这个问题 (https://www.getconvey.com/devblog/virtualbox-still-hates-sendfile/),是吗一种在 Cowboy Web 服务器中禁用 sendfile 的方法?
我很高兴地报告我已经在我自己的安装中解决了这个问题,详情如下:
解决发送文件问题的另一种方法是对共享目录使用 NFS。这是我使用的 Vagrant 配置,运行良好:
config.vm.synced_folder "/host/path/", "/guest/path/", type: "nfs", :mount_options => ['nolock,vers=3,udp,noatime,actimeo=1']
太棒了!然而,一个问题已解决,Phoenix 用于实时重新加载检测的 inotify 功能不适用于 NFS...
要解决该问题,请安装此 vagrant 插件:https://github.com/mhallin/vagrant-notify-forwarder
在这两个和重新加载来宾机器之后,实时重新加载完美无缺
另请注意,如果 Cowboy 能够禁用 sendfile,我猜就没有必要使用此解决方法。该修复的相关问题是:https://github.com/ninenines/cowboy/issues/812