-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
OrchardCMS Admin panel loads really slow on Azure App Service (Linux) when using WebOptimizer #11761
Comments
Looks like a TheAdmin theme issue since it doesn't find the assets. Though for the network speed I never experienced this under Azure. |
Thank for the reply. I'll focus on TheAdmin theme assets loading but it's weird that admin panel finally loads properly after several minutes |
Note sure this is going to help you much, but I would suggest you turn on the mini profiler feature on admin and see if that’ll give you additional data. https://docs.orchardcore.net/en/latest/docs/reference/modules/MiniProfiler/ I would also enable SSH on your container and run tracert from the container to the database server “or other services you are using” to make sure the connection between the services is solid. You can also look at the networking logs in Azure to see if there is more clues I am using OC on azure service app using docker container and have no issues. |
Thanks for the suggestion. I turned on the mini profiler but I couldn't target to a specific issue. Unfortunately I don't use a docker container but Azure App Service on Linux and I don't have much access to the host machine. When trying to execute any tracert/traceroute/tracepath/tracetcp/etc command from the Kudu (.scm) SSH environment, I get command not found. |
Are you using orchard source code or are you using nuge packages? Also verify that your asp net core environment is not Development |
The following line from the Azure Log Stream got me suspicious:
So I removed the LigerShark.WebOptimizer.Core nuget package from my project and everything loads normally now. However, I really don't know why there was a conflict between the admin panel and WebOptimizer. In Startup.cs I had the following in ConfigureServices(): And in Configure(): Also in _ViewImports: Removing only the code parts did not fixed the issue. Removing the entire nuget library did. Does anyone know why? |
I 'm on Production using nuget packages |
https://github.com/ligershark/WebOptimizer I think you may find an answer going on the WebOptimiser repository. Though, I'm not sure if that's a necessary library since in Orchard Core we build assets with a Gulp pipeline. We don't bundle assets on production server. This is maybe what is the issue there, it is trying to bundle/minify every assets that the requests has and some of them just don't get enough time to end processing and returns a 400 error. |
I have been also searching WebOptimizer repository without any luck. I 'm using WebOptimiser package to take advantage of the bundling, minification and cache busting options for my landing page because "Use resources cache busting" option in OrchardCMS does not seem to apply to my homepage. Neither does minification option (when in production mode). |
The "Use resources cache-busting" option will only change the URI if the assets have changed. If you are using the "response cache" then it might take some time before the page gets refreshed. The minification option in the admin is only there to say: use the minified version of the assets if any is provided to the ResourceManager. It won't minify the assets for you; it needs to be minified manually with the gulp pipeline. Here, when you are using the WebOptimizer you may need to use its own cache busting feature since you would then need to assert that our cache busting middleware is executed after the WebOptimizer one. There is clearly an issue here but we would need to start a PR to support WebOptimizer which is not something that is planned right now. You may want to take that task and start a PR if you want. |
It's weird that this "delay" seems to happen only when I deploy to Azure and not on my local machine where it works perfectly fine while bundling, minifiing and cache busting all script and style files in both my landing page and admin panel. I wish I find the strength to deal with this issue with a PR. Also, I don't know if this issue should be closed or stay open for anyone else who's struggling with similar problems. |
Keep it open, it will get triaged tomorrow. |
I personally think you should use the gulp pipeline simply. It will save you time. Also, using the native SASS and LESS and TypeScript compilators will keep you out of trouble most of the time by experience. This is why we are using a gulp pipeline because we had issues with these server-side solutions which don't follow the latest specs. |
I tried to use WebOptimizer as it runs simply as an out-of-the-box solution and I 've been already using it in older ASP.Net MVC projects. However, I 'll try to use gulp pipeline as you suggested. Thank you |
https://docs.orchardproject.net/en/latest/Documentation/Processing-client-side-assets/ We need to move this documentation to Orchard Core documentation. |
Please reopen if you think there is still a bug in OC |
I am using OrchardCMS (1.2.2) with SQL Server and everything works fine and smooth on my local machine.
However, when I publish my solution to Azure App Service (net5.0, self-contained deployment mode, linux-x64), the admin panel loads forever. For example, the admin of my landing page content type takes almost 5-6 minutes to load. My App Service is hosted on Azure by using Basic Tier, 1 B1 (1 Core(s) with 1.75 GB RAM, 10 GB Storage) on Linux OS and all my resources (app service, sql server, database, etc.) are hosted on West Europe datacenters.
Below I attach a screenshot from the network tab of chrome developer tools, showing how long each request takes to complete:
Below I attach a screenshot of one random request:
Meanwhile, when I monitor the Log Stream from my Azure App Service I get multiple requests of this type:
On the other side, when I run my solution from my local machine with VS2022 on debug mode and I connect to the remote Azure SQL Server DB, everything loads fine, so it seems not a database connection problem. I should mention that my landing page loads fine and I haven't faced any issue with my front page, loading issues occur only when accessing the Orchard Admin panel.
Do I have to configure any special setting while publishing to Azure ? Has anyone faced any similar issue before?
Thanks
The text was updated successfully, but these errors were encountered: