slymilano
slymilano
RRailway
Created by slymilano on 10/18/2024 in #✋|help
Seeing slow 50ms queries for simple select * of a 2000 record query to a Supabase database.
Example of a query that takes 54ms:
SELECT u0."id", u0."phoneNumber", u0."timezone", u0."createdAt" FROM "users" AS u0 WHERE (u0."phoneNumber" = $1)
SELECT u0."id", u0."phoneNumber", u0."timezone", u0."createdAt" FROM "users" AS u0 WHERE (u0."phoneNumber" = $1)
Normally when I host an app in Railway, the app and database are in the same geo and hosted by the same PaaS. I see much faster response times for much beefier queries and table sizes. So what's going on - why is Supabase so slow? - My app is currently hosted in Railway, US West (Oregon, USA) - My Supabase "app" (the database) is hosted in "West US (North California) - AWS t4g.small - I'm connect to Postgres using the ipv4 addon, and using the non pooler connection string url. Is this just the expected latency?
10 replies
RRailway
Created by slymilano on 8/20/2024 in #✋|help
Pushed to my repo and got a whole bunch of queued builds, and toast notifications?
No description
15 replies
RRailway
Created by slymilano on 4/9/2024 in #✋|help
Fresh Phoenix / Postgres project. DBConncetionError. Works fine on Render?
Hello, I'm trying out Railway after nearly two years to see what it's like. I'm seeing an error trying to run my brand new Phoenix project.
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2987ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:

1. Ensuring your database is available and that you can connect to it

2. Tracking down slow queries and making sure they are running fast enough

3. Increasing the pool_size (although this increases resource consumption)

4. Allowing requests to wait longer by increasing :queue_target and :queue_interval

See DBConnection.start_link/2 for more information

(ecto_sql 3.11.1) lib/ecto/adapters/sql.ex:1054: Ecto.Adapters.SQL.raise_sql_call_error/1

(elixir 1.16.2) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2

(ecto_sql 3.11.1) lib/ecto/adapters/sql.ex:1161: Ecto.Adapters.SQL.execute_ddl/4

(ecto_sql 3.11.1) lib/ecto/migrator.ex:755: Ecto.Migrator.verbose_schema_migration/3

(ecto_sql 3.11.1) lib/ecto/migrator.ex:563: Ecto.Migrator.lock_for_migrations/4

(ecto_sql 3.11.1) lib/ecto/migrator.ex:432: Ecto.Migrator.run/4

(ecto_sql 3.11.1) lib/ecto/migrator.ex:170: Ecto.Migrator.with_repo/3
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2987ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:

1. Ensuring your database is available and that you can connect to it

2. Tracking down slow queries and making sure they are running fast enough

3. Increasing the pool_size (although this increases resource consumption)

4. Allowing requests to wait longer by increasing :queue_target and :queue_interval

See DBConnection.start_link/2 for more information

(ecto_sql 3.11.1) lib/ecto/adapters/sql.ex:1054: Ecto.Adapters.SQL.raise_sql_call_error/1

(elixir 1.16.2) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2

(ecto_sql 3.11.1) lib/ecto/adapters/sql.ex:1161: Ecto.Adapters.SQL.execute_ddl/4

(ecto_sql 3.11.1) lib/ecto/migrator.ex:755: Ecto.Migrator.verbose_schema_migration/3

(ecto_sql 3.11.1) lib/ecto/migrator.ex:563: Ecto.Migrator.lock_for_migrations/4

(ecto_sql 3.11.1) lib/ecto/migrator.ex:432: Ecto.Migrator.run/4

(ecto_sql 3.11.1) lib/ecto/migrator.ex:170: Ecto.Migrator.with_repo/3
This same Dockerfile works fine on Render. Any ideas why this is happening? Project id is: 429a2255-e11f-4860-acd2-0d61fae16250
15 replies
RRailway
Created by slymilano on 10/13/2022 in #✋|help
Hey guys - quick Q is there a way to ssh into a running box so I can run rai
slymilano — 10/07/2022 Hey guys - quick Q: is there a way to ssh into a running box so I can run rails console against my prod and do some stuff against production data using my Ruby code? (This was not possible a few months ago, so I'm checking again)
8 replies
RRailway
Created by slymilano on 8/27/2022 in #✋|help
How can I open an interactive console into my box?
In Rails you could do in Heroku back in the day heroku run rails console. In Render.com I can just open the interactive shell in the website and bin/my_app console to get an interactive Elixir shell to run some commands inside my app. How can I do the same in Railway? I need to run some Elixir code against prod to create some records. Thanks!
8 replies
RRailway
Created by slymilano on 8/25/2022 in #✋|help
Google Domains custom domain help
28 replies
RRailway
Created by slymilano on 8/16/2022 in #✋|help
How to run database migrations?
In my Dockerfile, at the very end, I want to run the database migrations, then run the app server.
# Only copy the final release from the build stage
COPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/nuki ./

USER nobody

CMD ["/app/bin/migrate"]
CMD ["/app/bin/server"]
# Only copy the final release from the build stage
COPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/nuki ./

USER nobody

CMD ["/app/bin/migrate"]
CMD ["/app/bin/server"]
But it seems like my migrations are never executed. In the Build Logs I see:
#28 [stage-1 6/6] COPY --from=builder --chown=nobody:root /app/_build/prod/rel/nuki ./
#28 sha256:682213f68da1d2ab828e67a48b1dbe5877bcef4cc00e010e13656bf08da19357

#28 DONE 0.4s


#29 exporting to image
#29 sha256:e8c613e07b0b7ff33893b694f7759a10d42e180f2b4dc349fb57dc6b71dcab00
#29 exporting layers

#29 exporting layers 0.3s done
#29 writing image sha256:56c5a0f8bb77edd876bd3a34abf8989977de81ee815883dd285a2868fbf39a89

#29 writing image sha256:56c5a0f8bb77edd876bd3a34abf8989977de81ee815883dd285a2868fbf39a89 done
#29 naming to us-west1-docker.pkg.dev/railway-infra/railway-docker-users/project/4c052b8f-000c-44d0-b00a-2b650e36cf40/service/3a4fe599-38ed-432d-9263-66fb1ef9fd29:16762b8d-126e-46fc-9c12-63db8cba8a75 0.0s done
#29 DONE 0.5s

Build time: 21.25 seconds

================
Publishing Image
================
The push refers to repository [us-west1-docker.pkg.dev/railway-infra/railway-docker-users/project/4c052b8f-000c-44d0-b00a-2b650e36cf40/service/3a4fe599-38ed-432d-9263-66fb1ef9fd29]
Preparing 2f3b7ddf1a97
#28 [stage-1 6/6] COPY --from=builder --chown=nobody:root /app/_build/prod/rel/nuki ./
#28 sha256:682213f68da1d2ab828e67a48b1dbe5877bcef4cc00e010e13656bf08da19357

#28 DONE 0.4s


#29 exporting to image
#29 sha256:e8c613e07b0b7ff33893b694f7759a10d42e180f2b4dc349fb57dc6b71dcab00
#29 exporting layers

#29 exporting layers 0.3s done
#29 writing image sha256:56c5a0f8bb77edd876bd3a34abf8989977de81ee815883dd285a2868fbf39a89

#29 writing image sha256:56c5a0f8bb77edd876bd3a34abf8989977de81ee815883dd285a2868fbf39a89 done
#29 naming to us-west1-docker.pkg.dev/railway-infra/railway-docker-users/project/4c052b8f-000c-44d0-b00a-2b650e36cf40/service/3a4fe599-38ed-432d-9263-66fb1ef9fd29:16762b8d-126e-46fc-9c12-63db8cba8a75 0.0s done
#29 DONE 0.5s

Build time: 21.25 seconds

================
Publishing Image
================
The push refers to repository [us-west1-docker.pkg.dev/railway-infra/railway-docker-users/project/4c052b8f-000c-44d0-b00a-2b650e36cf40/service/3a4fe599-38ed-432d-9263-66fb1ef9fd29]
Preparing 2f3b7ddf1a97
And in my Deploy Logs:
21:26:31.624 [info] Running NukiWeb.Endpoint with cowboy 2.9.0 at :::6960 (http)
21:26:31.624 [info] Access NukiWeb.Endpoint at https://nuki-production.up.railway.app
21:26:31.624 [info] Running NukiWeb.Endpoint with cowboy 2.9.0 at :::6960 (http)
21:26:31.624 [info] Access NukiWeb.Endpoint at https://nuki-production.up.railway.app
So that last CMD does seem to be running, why would the one right above it not run? CMD ["/app/bin/migrate"]
23 replies
RRailway
Created by slymilano on 8/16/2022 in #✋|help
Is there support for nixpacks on Elixir and Phoenix?
thanks
16 replies