3 months ago
Hi all
I am new and testing the free tier.
I wanted to test a very simple Laravel app with filament, nothing fancy.
Production queries are incredidlbe slow. Page loads are 1-2 seconds. Local development its fine.
I have used DBHOST etc to connect to the datbaes. I also tried DBURL using the internal url to the db. It make no real difference.
Both web server and db server are on the same region.
Any ideas?
0 Replies
I use database sessions and the first query to get the session is about 500ms
Is this a connection thing? I think it might be your connection to the internet? I had the sme thing
Nope I have 1gb internet and no issues when deploying on Laravel forge with a cheap hetzner droplet
Local vs production.
I don’t have my benchmark from forge/hetzner but even that was much faster compared to railway setup thus far
3 months ago
when you say production, does that mean your application running on Railway?
Local is very fast ( not expecting local speeds)
Laravel forge using the cheapest hetzner droplet is very fast.
Railways is very slow in comparison.
I don’t think I have configured anything incorrectly but I’m open to suggestions
But for the same query request on local it’s 1ms vs 300-400ms on railway. Seems quite a steep increase
3 months ago
are you opening a new database connection for every db call?
3 months ago
is both your application and database on metal?
Yes both on metal and both same region. Spun up yesterday. Used railpack as per one of your YouTube videos on setting up a Laravel app
3 months ago
can you provide some full traces?
Not sure if this is what you are after but here goes. As you can see the first db call is by far the longest for what is a single record return. I turned off datbase sessions which was orignally top of the list, now that was removed this is the first in the list and now much higher.
3 months ago
yeah it looks like you are establishing a connection for every route, you would want to have a global connection pool