Server responds very slowly

Hello!

I hosted my project on node.js and express.js which was previously running on heroku.

I ran into a problem that the server responds very slowly - the pages take a very long time to load - 20 or even 50 seconds (!)

example - https://i.imgur.com/Pr6vpMN.png

The problem can be seen if you click on the pages - from the main page of travel tours to the page of an individual tour and back to the main page of all tours.

There were no such problems on heroku, everything worked quickly.

Query against mongodb database is fast - I store data in the cloud - I use mongodb atlas
Heroku didn’t have this problem. Do not tell me what could be the matter?

Maybe the problem is that I use a free plan, but everything works fast on a paid one?

Here is my project - https://natours-kn96.onrender.com/

Here is the link to github.com - GitHub - haosmos/natours-node: Сервис для покупки туров путешествий

HI,

I’ve replied to the ticket you’ve also opened. I’ll share the same response:

The long request sounds like the first request after the service has spun down, which happens after 15 minutes of no requests on the free instance type. So the first request to spin the service back up can take that long. More on this here: https://render.com/docs/free#free-web-services

As for ongoing requests, they are quicker than the initial one described above, but do seem a little labored. Your Render service is provisioned our Oregon region. Heroku doesn’t provide an Oregon region on their Common Runtime, so I’m wondering if your MongoDB is hosted in a geographically distant region causing some unnecessary latency.

Kind regards

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.