App running in multiple regions is really slow

Hi,

I have a Rails app running in multiple regions, with the primary region being lhr. This is the current setup:

app     5       shared  1       1024 MB iad,lhr(3),syd
solidq  5       shared  1       1024 MB iad,lhr(3),syd

In the primary region, it is super fast. In all other regions though, it is very slow. I think this is DB related, so I also scaled my Fly Postgres machines as so:

NAME    COUNT   KIND      CPUS    MEMORY  REGIONS
               5              shared   1            1024 MB    iad,lhr(3),syd

I have also installed the ‘fly-ruby’ gem, which is supposed to handle replica regions and route traffic accordingly.

From using a VPN I can see that the request is going to the correct place, but that ActiveRecord is taking ages to load:

syd [info][31d82c8c-fefb-4fb4-97bb-99fc32769b5f] Completed 200 OK in 35145ms (Views: 319.6ms | ActiveRecord: 35320.4ms (86 queries, 28 cached) | GC: 41.7ms)

Am I missing something? Any help with this would be appreciated.

Try shelling into your machine, installing a MySQL console client, and issue some read and write queries on the same database. That will see if your Ruby db driver is part of the cause.

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