a month ago
I’ve deployed my backend on Railway with a database connected. The issue is that when attempting to perform server side calculation on client side entries into my database the page just indefinitely loads and client eventually disables connection as it never loaded. Is this something wrong with my database
Can you please help me figure out what’s going on, or fix it from your side if possible?
project id: da03cb8a-3d81-4e9a-aee1-8f121a6b4399
I have a server, client and postgres services each of which deploy fine but server has this https error everytime i try use it - i think its everytime although only really testning it on sone thing,
Attachments
16 Replies
a month 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!
a month ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open brody • 30 days ago
a month ago
Hey, one of the reasons for higher page loading time is when your database and service are not in the same region. Can you confirm this by checking each service to verify they're in the same region?
a month ago
can an employee go into the project and test the function? see whats wrong with it?
a month ago
maddie-houseman
can an employee go into the project and test the function? see whats wrong with it?
a month ago
I'm afraid not as that does not look like to be a Railway problem and Railway does not offer support for problems on your service.
a month ago
They are in the same region, and differing region wouldn't cause it to hang. Just be slightly slower. That is not the issue.
a month ago
is there anything i could show you to tell what the problem is?
a month ago
um let me check
a month ago
oh no i hadnt checked the postgres logs they seem to have many errors so i can look through those now, here are the errors if you know what the problem is
Attachments
a month ago
That looks like to be normal, is your entire website with slowness or is it specific page?
a month ago
no only one button but i think that is because so far that's the only one i can test that does anything more than just writing to the database or moving around the application
a month ago
If the rest of your website is functioning normally and only that button is causing an issue, then my guess is that the feature you've implemented is simply too slow.
Can I know exactly what it does? Is it a simple insert or does it perform multiple read and write operations?
a month ago
Can you confirm that the rest of your queries (the most simple ones, like a single read) are working properly too? That would eliminate a lot of issues that I'm thinking of.
a month ago
The L4 ROI computation performs 4-6 sequential database operations per request: it first checks/creates a company record, then queries L1 operational data (budgets/employees), L2 allocation weights, and L3 benefit weights, processes this data through calculation logic, and finally creates or updates an L4 snapshot record.
Regarding simple queries - yes, I can confirm that basic single-read operations are working properly. The server health endpoint responds instantly, and simple database connection tests complete in 1-2ms. The issue is specifically with the complex L4 computation that performs multiple sequential database operations and data processing.
Although the button will only time out after 15 mins if left without a timeout addition - also when that happens logs say something like "client has closed the request before the server could send a response" with HTTP status 499.
maddie-houseman
The L4 ROI computation performs 4-6 sequential database operations per request: it first checks/creates a company record, then queries L1 operational data (budgets/employees), L2 allocation weights, and L3 benefit weights, processes this data through calculation logic, and finally creates or updates an L4 snapshot record.Regarding simple queries - yes, I can confirm that basic single-read operations are working properly. The server health endpoint responds instantly, and simple database connection tests complete in 1-2ms. The issue is specifically with the complex L4 computation that performs multiple sequential database operations and data processing.Although the button will only time out after 15 mins if left without a timeout addition - also when that happens logs say something like "client has closed the request before the server could send a response" with HTTP status 499.
a month ago
If it's 4-6 sequential table scans on a big table, then yes, that might take a lot of time. However, if most of them are just executing simple queries with database indexes, then I would look further into what's happening.
If I were you, I'd set up tracing (Sentry can do that btw) or simply use console.logs (or print, depending on your language) to find the slowest operation.
