High variation in query time between app and Postgres DB

I am currently experiencing wild fluctuations between my app and the postgres instance. Example results of the super simple SELECT 1 query from the app to postgres:

D, [2024-01-04T14:03:38.966436 #311] DEBUG -- :    (6.4ms)  SELECT 1
D, [2024-01-04T14:03:40.026046 #311] DEBUG -- :    (2.1ms)  SELECT 1
D, [2024-01-04T14:03:40.768105 #311] DEBUG -- :    (10.1ms)  SELECT 1
D, [2024-01-04T14:03:41.414116 #311] DEBUG -- :    (7.3ms)  SELECT 1
D, [2024-01-04T14:03:42.070859 #311] DEBUG -- :    (12.6ms)  SELECT 1
D, [2024-01-04T14:03:42.777121 #311] DEBUG -- :    (15.7ms)  SELECT 1
D, [2024-01-04T14:03:43.326280 #311] DEBUG -- :    (5.9ms)  SELECT 1
D, [2024-01-04T14:03:43.976163 #311] DEBUG -- :    (13.7ms)  SELECT 1
D, [2024-01-04T14:03:44.533642 #311] DEBUG -- :    (3.1ms)  SELECT 1
D, [2024-01-04T14:03:45.120902 #311] DEBUG -- :    (12.4ms)  SELECT 1
D, [2024-01-04T14:03:45.746435 #311] DEBUG -- :    (19.4ms)  SELECT 1
D, [2024-01-04T14:05:06.193505 #311] DEBUG -- :    (11.9ms)  SELECT 1
D, [2024-01-04T14:05:06.839534 #311] DEBUG -- :    (2.6ms)  SELECT 1
D, [2024-01-04T14:05:07.461207 #311] DEBUG -- :    (17.6ms)  SELECT 1
D, [2024-01-04T14:05:07.998286 #311] DEBUG -- :    (6.3ms)  SELECT 1
D, [2024-01-04T14:05:08.549035 #311] DEBUG -- :    (7.8ms)  SELECT 1
D, [2024-01-04T14:05:09.717185 #311] DEBUG -- :    (5.3ms)  SELECT 1
D, [2024-01-04T14:05:10.357257 #311] DEBUG -- :    (19.4ms)  SELECT 1
D, [2024-01-04T14:05:10.853704 #311] DEBUG -- :    (11.9ms)  SELECT 1
D, [2024-01-04T14:05:11.379177 #311] DEBUG -- :    (6.5ms)  SELECT 1
D, [2024-01-04T14:05:11.896595 #311] DEBUG -- :    (4.2ms)  SELECT 1
D, [2024-01-04T14:05:12.459155 #311] DEBUG -- :    (15.6ms)  SELECT 1
D, [2024-01-04T14:05:12.953230 #311] DEBUG -- :    (7.8ms)  SELECT 1
D, [2024-01-04T14:05:13.488233 #311] DEBUG -- :    (5.6ms)  SELECT 1
D, [2024-01-04T14:05:14.095271 #311] DEBUG -- :    (29.0ms)  SELECT 1

Both app and the db are in the same region (waw). Is this something wrong on Fly.io’s or did I misconfigure the app?

  • postgres instance:

    shared-1x-cpu@256MB

  • app instance:

    shared-1x-cpu@512MB

Similar issue seems to be between the app and Upstash Redis, also in the same region (waw).

There’s also very minimal load on the DB side, too:

This should’ve returned to normal. There was uncaught abuse using a lot of resources in WAW.

Thank you, Jerome! Seems to be back to normal on my side :slight_smile:

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