-
Notifications
You must be signed in to change notification settings - Fork 12k
SSG Prerendering gives timeout when rendering big numb of urls or api takes time to response #29135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@uttamughareja you can have a look at #29005 in the CLI project. A similar discussion (feature request) to make the time_out configurable has been discussed. I hope that helps to shed some light on what you are facing and give you some directions. |
This is not entirely accurate, as only up to four routes are generated in parallel. While we could implement an option to configure the timeout, it raises the question about how the APIs will perform under real traffic conditions in production environments. |
Hi, based on above response, you should verify if your server is getting all requests in parallel or only four by adding request log in server. 30 sec seems like a reasonable timeout. |
If you need to reduce the number of pages being rendered simultaneously, you can configure the |
Closing, as rendering a single route in approximately 30 seconds seems reasonable. However, it is recommended to improve the API performance, as limiting to only 4 parallel requests can cause a significant bottleneck, even in a production environment. As a workaround, you can use the use the environment variable mentioned above to reduce the number of routes rendered in parallel, which has an upper limit of 4. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
I tried to build my app with following setting, I have ~20k urls to build. and because all requests are sent concurrently from the build process, the api is taking time to process all these concurrent requests.
{
...
"prerender":{
"routesFile": "prerender-urls.txt",
"discoverRoutes": false
},
"ssr": false
...
}
because of this delay, the page is taking more time to response than Agular build process waits and it fails with timeout error.
I did my research and opened a stackoverflow issue after I couldn't find any proper solution to this. I see other people facing the same problem. so opening this issue.
Please provide a link to a minimal reproduction of the bug
create a new app with 1 component, enable prerender with few diff parameter urls that needs backend api calls, api should simulate a delay in response about 5 min or more to make it happen fast, build angular app and wait until the build throws a timeout error.
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
it would be helpful if there is a way either in angular or node rendering engine to set a value for wait period before throwing a timeout error.
I believe this is one of the most common scenarios that many people are and will face it while using SSG with large amount of pages and slow apis.
thanks
The text was updated successfully, but these errors were encountered: