2 months ago
I have a very simple setup with this app. I have a postgres instance, a backend (nodejs express) instance, and a vite react frontend. I have done as much as I can to optimize some of these things within reason, to no avail. And my region is correct (us east) on all three.
I have some functions that are not necessarily easy, and I don't need it to be lightning fast, but these speeds I am currently getting are making my app entirely unusable. Here are the logs:
[API] POST /schedule/assigned-schedules-for-week -> 200 took 20241ms
[API] POST /schedule/assigned-schedules-for-week -> 200 took 20548ms
[API] POST /schedule/assigned-schedules-for-week -> 200 took 20551ms
[API] POST /schedule/assigned-schedules-for-week -> 200 took 38780ms
[API] POST /schedule/assigned-schedules-for-week -> 200 took 39276ms
[API] POST /schedule/assigned-schedules-for-week -> 200 took 39423ms
[API] POST /schedule/assigned-schedules-for-week -> 200 took 38868ms
[API] POST /schedule/assigned-schedules-for-week -> 200 took 38869ms
[API] POST /schedule/assigned-schedules-for-week -> 200 took 38868ms
It is taking upward of 30 seconds to complete this request. The table I am accessing from only has about 15 rows right now, as I only have 3 test users. And in no way is the code I am running on the backend taking that long.
I know that the hobby plan uses shared storage. But requests like this should not take 30 seconds to complete. I am no professional, so I could be simply doing something wrong, or missing something obvious.
I would truly appreciate any sort of insight with this. :)
EDIT: I would also like to point out that I have ensured that I am not establishing a new connection to the database with each call, I am maintaining a stable connection the entire time.
4 Replies
2 months ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
2 months ago
Sharing the code for what that POST does would make it easier to get help. A 20-30 second delay is clearly a code issue or something on your end, especially if the logs are coming from the console.
2 months ago
Can you view the metrics of the Postgres database? Do things look to be throttling? What's the usage like? Does this happen locally too? Are you using the internal IP?
2 months ago
After some time, it appears that there was a strange discrepancy caused when switching between trial plan and hobby plan. After upgrading, there was a spice in the delay for a good few hours until it seemed to settle down, and the request times appear to be back to normal now. Marking this as closed.
Status changed to Solved nathanalger • about 2 months ago