7 months ago
I currently run my fastapi server on railway metal us west california
32gb ram 32 vcpu. however resposne times are very slow, does anyone know how I can fix this? these are simple queries to my database that are hosted on the same project same servers, and the database is mongodb with like maybe 1mb max each database
11 Replies
7 months ago
Hey, are you using private networking to connect to your mongodb database?
Dont know but i might be
im using the motor async mongodb client for python and i just use my connection strings
7 months ago
in your environment variable for your database, can you check if it contains railway.internal?
```python
from motor.motor_asyncio import AsyncIOMotorClient
def getmongoclient():
clienturi = "mongodb://@junction.proxy.rlwy.net:33514" return AsyncIOMotorClient(clienturi)```
7 months ago
You're not using private networking, I recommend you removing that hardcoded URL and instead adding a environment variable