Hi All,
I’m looking at moving my Laravel 10 stack from a Hetzner virtual machine to Fly. I’ve deployed my app successfully, but I’m seeing strange performance issues at intervals when accessing my main page. The page usually responds and loads in under 200ms. However, sometimes it spikes inexplicably and can take over 10s to load a static page. I don’t get these issues on my Hetzner VM, so I can conclude it’s something in my new Fly setup.
I was troubleshooting using Apache bench with the command ab -n 6336 -c 20 https://example.com/
example.com
DNS is managed by CloudFlare. I’m using a custom domain with dedicated IPv4 and IPv6 addresses on my app, with those addresses added as A
and AAAA
records in Cloudflare respectively.
These issues are also present when using the default *.fly.dev
URL, so CloudFlare is not the issue.
I currently only have 1 machine provisioned on Fly which is shared-cpu-2x@1024MB
deployed in LHR.
Some images to show the issue, all of these were taken during the ApacheBench stress test.
CPU Usage
Firecracker Usage
HTTP Response Times
Fast, Normal App Response Times
During Spikes
HTTP Response Times 2
These issues are really the only thing preventing me from making the switch to Fly. I don’t really know much about the backend networking, and any optimisations that are needed, but my current VM with the same specifications at Hetzner does not suffer from these issues.
For context my Hetzner VM can handle ~20RPS, whereas the same site on Fly can only manage a measly 9RPS - The difference is quite significant, and is quite obvious when using my site.
I thought it may have been that PHP simply couldn’t handle that many requests on Fly, however even just with 1 user (myself) simply navigating around the site will trigger the issue. There are no database requests on the main page, and my database in general is on Planetscale also in LHR.
Any thoughts? Happy to provide more details if needed.
Thanks