Symfony2 + Vagrant 性能 - 运行缓慢 - 加速? [英] Symfony2 +Vagrant performance - running slow - speeding up?

查看:39
本文介绍了Symfony2 + Vagrant 性能 - 运行缓慢 - 加速?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始使用 vagrant 和 Symfony2.* 来开发 Web 项目.我使用的是 Windows,性能很慢,因为不支持 nfs 挂载.

I have started using vagrant with Symfony2.* to develop Web projects. I am using Windows, performance is very slow, because nfs mount isn't supported.

我已将缓存放入内存中,这提供了奇特的提升,禁用了 xdebug(如 此处).但是,在 Windows 机器上的开发环境中,页面加载时间仍超过 14 秒.任何帮助将不胜感激.

I've put cache into memory, which gave exotic boost, disabled xdebug (as posted here). However page still loads in more than 14 seconds in dev enviroment on windows machines. Any help would be appreciated.

Symfony >=2.3,PHP >= 5.4,Windows 7,Dell Precission m6700 四核 i7/16GB/SSD

Symfony >=2.3, PHP >= 5.4, Windows 7, Dell Precission m6700 quad-core i7/16GB/SSD

推荐答案

尽管在开发 Drupal 站点(也是基于 PHP)时,我也遇到了同样的性能问题.最近,我通过使用新的 rsync 文件夹功能,这是在 Vagrant 1.5 中引入的.

I've had the same performance problems, although with developing Drupal sites (also PHP based). Lately I've had quite some success by using the new rsync folder feature, which was introduced in Vagrant 1.5.

如果您正在处理大量文件(10.000 - 100.000),我会发现内置的 rsync-auto 功能很难跟上.切换到 这个简洁的小插件 拯救了我的一天.就像 vagrant rsync 文件夹功能一样,gatling rsync 插件也只提供单向同步(主机 -> 访客).由于很多 Drupal 工具和指南针会在来宾上生成文件,这个插件 将有助于将更改从访客同步到主机.

If you're working with a large number of files (10.000 - 100.000), I experienced that the built-in rsync-auto feature had a hard time keeping up. Switching to this neat little plugin saved my day. Just as the vagrant rsync folder feature, the gatling rsync plugin also only provides a one way sync (host -> guest). Since a lot of Drupal tools and compass generate files on guest, this plugin will help to sync the changes from guest to host.

如果您正在寻找比较:在这里,您可以找到有关 rsync 与 NFS 的最新基准博客文章.

If you're looking for a comparison: here you can find a recent benchmark blog post on rsync vs NFS.

这篇关于Symfony2 + Vagrant 性能 - 运行缓慢 - 加速?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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