I have my production app deployed on Netlify and my main use case for the next one year is users located in India.
These are my apps site id:
c1c40b52-6ac2-425c-ad35-b8e61d32d4dc
925f9b60-a694-47a1-b41a-d34bb0c156f7
My app is too slow as the app is deployed in Singapore region. Please can you consider having a hosting region in India too. I am very happy with the service, and want to contue using netlify for my startup. I was looking at heroku and digitial ocean as alternatives and it is not as good as netlify for my usecase.
Hi @ramyasanghaofficial i’m sorry to hear your site is not running as fast as you’d like. I filed a feature request for this but as I mentioned this may not happen at least not in the immediate future. I think you should look into ways to optimize your app and utilise cache to the best of your ability to hopefully speed it up.
I understand this may not be the solution you are looking for but I hope I provided some insight.
What do you mean by utilizing cache? I am using graphql as my middleware. When i moved the site from us to singapore the speed doubled. When i run it locally, the main request takes 600 micro seconds and on netlify the same request takes 1.82 seconds. My db is in mumbai.
Are there any other netlify configuration tips to make this faster?
I know i already asked - i am raising this as a feature request and a separate topic to get visibility with the netlify team. And if there were other such similar requests - hoping prioirty could get higher.
@ramyasanghaofficial You’ve actually posted this under the “Support” category, if you intended it to be a “Feature Request” you should use the relevant category here:
I’m not sure if the site you linked in the other thread (https://master.sanghaone.com) is a good indication of your current site, but viewing it from my location on decently fast internet, the only thing really slowing it down is some quite large images:
So i cleared cache and reran, the graphql fetch is the main request i am talking about. The request that is showing for you as 400 ms, is 1.6 - 1.8 seconds for me. I am viewing it from Bangalore, India on a very fast internet. I am aware of the the large images - it is lazy loaded in the dom.
So its probably not the fact that it is hosted in Singapore, and the way i am using this service? The server is also deployed on netlify - server.sanghaone.com, and it is a node/express/graphql/mongodb combo with serverless functions.
Do i need to configure it a particular way to reduce this waiting time ? Any insights into this will help me a lot.
The problem in your case is not the location. Network connections these days from Mumbai/Banglore to Singapore should take hardly a few milliseconds. The problem you’re seeing is AWS Lambda cold-starts:
Notice the init duration. Those go up to about 1.8s! This means, it looks AWS Lamabda 1.8s to just start executing your Functions. The actual execution took less than 100ms as you can see in “Duration”.
Thank you for you’re response. I went through the documentation you shared and understand the problem more.
Do you know what is a typical initialization time for express node js? Ive gone through the documentation - cant figure out a direct way to reduce this. I made one change to specificaly import @aws-sdk/client-s3 instead of @aws-sdk. But didnt see much impact.
I have google auth library, apollo server and graphql as other dependencies. Its a simple express app that talks to mongodb, using rest apis and graphql endpoints.
they mentioned Provisioned Concurrency to optimize cold start times - is that somethin that can be provided in netlify?
Are there any tools that i can use from netlify that can help me diagnose which part of the init is taking that much time?
The initialization time for an Express Node.js application can vary depending on various factors, but it’s difficult to provide a typical initialization time as it can differ from case to case.
When it comes to reducing initialization time, there are a few strategies you can consider:
Minimize dependencies
Optimize code
Leverage caching
With AWS SDK and @aws-sdk/client-s3, importing a specific module instead of the entire SDK may not significantly impact the initialization time, but impact may be more noticeable during runtime.
To diagnose the specific parts of your initialization process that are taking longer, you can use various tools:
Profiling tools: Use tools like Chrome DevTools or Node.js profiler to identify performance bottlenecks in your code.
Logging: Add detailed logging statements to your initialization process to track the progress and identify potential areas of slowdown.
Performance monitoring: Utilize application performance monitoring (APM) tools like New Relic, Datadog, or AWS X-Ray to get insights into the performance of your application and pinpoint areas that need improvement.