Is Laravel really this slow?

后端 未结 10 1591
长情又很酷
长情又很酷 2020-12-04 06:20

I just started using Laravel. I\'ve barely written any code yet, but my pages are taking nearly a second to load!

\"

10条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-04 06:55

    I know this is a little old question, but things changed. Laravel isn't that slow. It's, as mentioned, synced folders are slow. However, on Windows 10 I wasn't able to use rsync. I tried both cygwin and minGW. It seems like rsync is incompatible with git for windows's version of ssh.

    Here is what worked for me: NFS.

    Vagrant docs says:

    NFS folders do not work on Windows hosts. Vagrant will ignore your request for NFS synced folders on Windows.

    This isn't true anymore. We can use vagrant-winnfsd plugin nowadays. It's really simple to install:

    1. Execute vagrant plugin install vagrant-winnfsd
    2. Change in your Vagrantfile: config.vm.synced_folder ".", "/vagrant", type: "nfs"
    3. Add to Vagrantfile: config.vm.network "private_network", type: "dhcp"

    That's all I needed to make NFS work. Laravel response time decreased from 500ms to 100ms for me.

提交回复
热议问题