Slow response using SQLite

Hi,

I’m in the process of evaluating fly using SQLite for a new project. I just deployed my app (NodeJS using Remix) on 2 machines located in CDG using LiteFS and the response times are quite slow.

My endpoint is simple: it does an SQL request and returns the result as JSON.

I usually get a response time of around ~500ms which seems high.

I took a screenshot of a response. The server is answering quite quickly, but on the network tab it’s still slow


Screenshot-202408-24 at 22.00.25

Any idea on how I could improve this?

1 Like

Are you sure that the latency is from LifeFS?
The initial connection and SSL seem kinda slow.

I’m not sure, I’ll try to create a new app with a simple sqlite database in a volume instead of LiteFS and look at the difference.

I have updated my post with more screenshot and data

6ms is what I was expecting from the sqlite query itself, so I don’t think liteFS is the issue. What happens when you remove the db query and have your api just return an empty json.

I tried to deploy the same app without using Litefs, I get the same result. The server answer quickly, but I still have up to ~500ms in the network tab.

The server responded in 32ms, but I go a ~500ms network call
Screenshot-202408-24 at 22.30.01

Maybe next try cloning a machine into LHR or AMS, stopping the others, and then repeating the experiment (again without LiteFS—as the primary_region will be offline).

CDG had network problems recently, which the latest Infrastructure Log [&] traced to a “customer deployment of a very high-traffic public API”. That may have flared up again…

Here’s everything I tried to far, with the same latency:

  • Deploy my code in a new app without LiteFS: same latency issue
  • Same as above, your remove all queries and just return a json: same latency issue
  • Same as above, but create a machine in AMS: same latency issue
  • In my LiteFS app: add a new node to AMS: same latency issue

My next try tomorrow will be to deploy my app on Vercel and see if performance are better (using a PG db) then I’ll try on custom VPS

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.