roots / trellis

WordPress LEMP stack with PHP 8.2, Composer, WP-CLI and more
https://roots.io/trellis/
MIT License
2.51k stars 607 forks source link

Fix libvirt Vagrant provider config #1491

Closed Simbaclaws closed 1 year ago

Simbaclaws commented 1 year ago

I made a mistake where I had used square brackets instead of pipes, potentially breaking the Vagrantfile. I'm sorry....

Simbaclaws commented 1 year ago

I did an actual test this time (after making some changes) to see whether it is working. Here are some screenshots of libvirt working:

Changes made in RAM: Changed the memory

Machine running afterwards: Running site

Simbaclaws commented 1 year ago

There seems to be a slight ttfb of 1-2 seconds, which I'm trying to fix but not really sure where it is coming from in the VM... I'm thinking it might be some sort of I/O issue? Maybe bindfs?

As you can see it is waiting for 2.3s here on first html ttfb load:

TTFB

swalkinshaw commented 1 year ago

Thanks for the quick fix (+ @talss89) Also my fault for not noticing that.

The TTFB issue could be a lot of things but I'll merge this for now and if there's any Vagrant setting that improves that a follow-up fix is good.

Simbaclaws commented 1 year ago

I just added the latest commit to change the accelerator for the VM to KVM (Right before you merged the fix), this should make the virtual machine a lot faster, I'm hoping that fixes the TTFB issue. I'm testing that right now. This does mean that whoever uses libvirt needs kvm and qemu both installed on their machine. I'm currently recreating the virtual machine, and it already feels a lot faster.

EDIT: there we go, test results are in:

Screenshot from 2023-05-27 18-14-02

TTFB issue solved :+1: 152ms vs 2.31s This thing is blazing fast...

To be sure I also did a sudo vagrant plugin install vagrant-bindfs on the host, just to make sure that bindfs was working properly.