Delay
beryberykz
HOBBYOP

2 years ago

I will try to describe the problem in as much detail as possible by attaching skins
First
I deployed the backend on the railway according to the guide along with the admin panel, I placed the storefront in Vercel.
__
When the site first loads, I have a lag of 3.5 seconds, or 5.1 at worst.

I tried to solve the issue myself and find the reason, but . to no avail.
Which way can you go to resolve the issue?

46 Replies

beryberykz
HOBBYOP

2 years ago

8b1e4ae6-f221-4948-a158-23868f94c7db


beryberykz
HOBBYOP

2 years ago

punched the pockets locally to the front and to the back
I'm trying to find an opportunity to connect to the front host and from there push packets to the back. I don't know how to do this in Vercel
Maybe from the railway to vercel to break through the packages


beryberykz
HOBBYOP

2 years ago

1227959503463649300


beryberykz
HOBBYOP

2 years ago

1227959583608275000


2 years ago

This latency you are seeing is very likely due in part to your services being so far apart geographically from one another, your railway service would be located in us-west, and your frontend would likely not be anywhere close that, and who knows where your database is.

you would ideally want to host everything on railway in a single region.


beryberykz
HOBBYOP

2 years ago

My entire railroad environment is in one state.
And the frontend for Vercel is located in a neighboring state.
As far as I understand
When I log into my domain poly-house.kz
He makes a request to the front, front makes a request to the backend, receives it and sends it to me.
There should be a minimum difference between the front and back since they are located in neighboring states

1228187751288017000
1228187751568900000
1228187751967494100
1228187752235794400


2 years ago

do you have a link to your website where I can reproduce this delay?

where are you located?


beryberykz
HOBBYOP

2 years ago


beryberykz
HOBBYOP

2 years ago

I thought it was the images and deleted them
But this saved a maximum of 0.8 - 1.2 seconds


beryberykz
HOBBYOP

2 years ago

I don’t know if this is possible, maybe it’s a domain issue


2 years ago

you are quite far away from your servers


2 years ago

who is your domain provider?


beryberykz
HOBBYOP

2 years ago

Vercel frontend ?


2 years ago

both vercel and railway


beryberykz
HOBBYOP

2 years ago

wait a little bit pls


2 years ago

this is a SSR rendered page right?


beryberykz
HOBBYOP

2 years ago


beryberykz
HOBBYOP

2 years ago

yes


2 years ago

are you using a custom domain on your railway services?


beryberykz
HOBBYOP

2 years ago

noop
But use custom on the vercel

1228189693204627500
1228189693506752500


2 years ago

this is next right?


2 years ago

the frontend I mean


beryberykz
HOBBYOP

2 years ago

Yea


2 years ago

do you ever have the clients browser call the railway service?


beryberykz
HOBBYOP

2 years ago

I don't quite understand the question


2 years ago

when a user visits your frontend, will their browser ever make a call to the backend that's running on railway?


beryberykz
HOBBYOP

2 years ago

Yes, product pictures, product descriptions, prices, etc. are stored on the server
Also, when placing an order, the data is stored on the server

1228190759904346000


2 years ago

sorry but that doesn't quite answer my question, and I'm not too sure how I could clarify further


beryberykz
HOBBYOP

2 years ago

In order to avoid the option of a delay from the frontend server and domain, I have now deleted all the content, leaving a simple “hello”
And loading is really fast

1228191334494634000


2 years ago

can you please answer my question


beryberykz
HOBBYOP

2 years ago

If I understand correctly then no.
It will only call the front, which via the API will call the server part on the railway


2 years ago

okay that sounds like about right


2 years ago

I would recommend running the frontend on railway and connecting to the medusa backend via the private network


beryberykz
HOBBYOP

2 years ago

Deploy the front locally and connect to the backend?
I’m not sure, maybe my code is simply written very poorly and that’s why there are lags..


2 years ago

deploy the frontend on railway and connecting to the medusa backend via the private network


beryberykz
HOBBYOP

2 years ago

What do you mean by private network?


2 years ago

railway's private network


2 years ago

it allows two services in a project to talk to each other privately


beryberykz
HOBBYOP

2 years ago

Thank you very much I'll try something


beryberykz
HOBBYOP

2 years ago

@BrodyI tried various options, now I want to test it by running the front and back on the railway.
Please tell me how can I use npm install instead of yarn and configure the build command

1228251814865141800


beryberykz
HOBBYOP

2 years ago

@Brody
nixpacks.toml Is it configured correctly?

1228254492005372000


beryberykz
HOBBYOP

2 years ago

OK
I was able to deploy my frontend application…
This is the same repository that is hosted on Vercel, but here for some reason it fell on 8000 localhost and I can't enter it

1228272019817365500



2 years ago

why delete?


beryberykz
HOBBYOP

2 years ago

@BrodyIt didn’t work out and I decided to stop trying and not waste your time


2 years ago

fragly helped you


Loading...