关于DNN的性能增强
关于DNN的性能增强,转自http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/486/Default.aspx
作者:Charles Nurse (DNN核心团队成员)
Many people have commented that the dotnetnuke.com site is a little slower with the recent upgrade to 4.3.1 (especially for Login).
If your site has a lot of users, you are probably getting the same "poor" performance. (Note - the problem is not confined to 4.3.1 - it will also be a problem with 3.3.1, as it is due to one of the new User features).
However, there is a simple solution, and here it is.
1. Log in as admin or host
2. Go to the "User Accounts" module (on the Admin menu).
3. Select the "User Settings" module action
4. Click Update to save the Settings.
Savvy users will have by now figured out the problem - The User Settings, which are implemented as Module Settings in the Database do not exist (are null). Loading the User Settings page loads the default values and clicking "Update" persists them to the database.
Normally, when custom Module Settings are not "set" this does not affect performance but in this case there is a very expensive query that is run when retrieving the default settings. This query will run every time a setting is needed, because, the GetSetting uses a fallback approach:
a) - try fetching the settings from the Cache
b) - try fetching the settings from the Database
c) - load the default settings (which calls the expensive query GetUserCountByPortal)
d) - get the setting from the collection of settings
On this site, when logging in, 3 different settings are needed, so the query is made 3 times - at a cost of about 800ms each (due to 300,000 users), hence the performance issues.
Now that I have carried out the procedure above (1-4) on this site, the default settings have been persisted to the Database, and the caching mechanism can work - Login is much faster.
A fix will be added to the next version, so that default values are automaticaly saved to the database on upgrade (or first access).
作者:Charles Nurse (DNN核心团队成员)
Many people have commented that the dotnetnuke.com site is a little slower with the recent upgrade to 4.3.1 (especially for Login).
If your site has a lot of users, you are probably getting the same "poor" performance. (Note - the problem is not confined to 4.3.1 - it will also be a problem with 3.3.1, as it is due to one of the new User features).
However, there is a simple solution, and here it is.
1. Log in as admin or host
2. Go to the "User Accounts" module (on the Admin menu).
3. Select the "User Settings" module action
4. Click Update to save the Settings.
Savvy users will have by now figured out the problem - The User Settings, which are implemented as Module Settings in the Database do not exist (are null). Loading the User Settings page loads the default values and clicking "Update" persists them to the database.
Normally, when custom Module Settings are not "set" this does not affect performance but in this case there is a very expensive query that is run when retrieving the default settings. This query will run every time a setting is needed, because, the GetSetting uses a fallback approach:
a) - try fetching the settings from the Cache
b) - try fetching the settings from the Database
c) - load the default settings (which calls the expensive query GetUserCountByPortal)
d) - get the setting from the collection of settings
On this site, when logging in, 3 different settings are needed, so the query is made 3 times - at a cost of about 800ms each (due to 300,000 users), hence the performance issues.
Now that I have carried out the procedure above (1-4) on this site, the default settings have been persisted to the Database, and the caching mechanism can work - Login is much faster.
A fix will be added to the next version, so that default values are automaticaly saved to the database on upgrade (or first access).
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· [AI/GPT/综述] AI Agent的设计模式综述