0

我们一直在为拥有大型站点的客户在 2sxc 上进行大量投资。我们已经构建了许多自定义应用程序,并在默认内容应用程序中添加了相当多的内容类型。

大约一个月前,我们开始看到在 Content App 中保存前端数据和保存 ContentTypes 时速度很慢(但仅限于那里)。该网站将需要 20 - 30 秒来保存。现在它变得更糟并开始间歇性地抛出异常。保存不超过 30 秒。其他时候是60秒。内容偶尔无法保存,我们收到下面列出的错误消息和异常。

但是,我们在博客应用程序和我们的自定义应用程序等其他应用程序中保存内容没有问题。那里的表现很好。通常,2sxc 模块似乎也适合前端用户。

我们在 DNN 7.4.2 上运行 2sxc 8.4.5。


这是最初的错误消息:

Had an error talking to the server (status 400)
Message: Bad Request
Detail: Error getting List of Stream.
Stream Name: Default
DataSource Name: QuickCache

Failed to load resource: the server responded with a status of 400 (Bad Request)
POST [removed]/en-us/desktopmodules/2sxc/api/eav/entities/savemany?appId=2 400 (Bad Request)
(anonymous) @ VM2141:2
(anonymous) @ set.min.js?sxcver=8.9.1.13916:103
n @ set.min.js?sxcver=8.9.1.13916:99
(anonymous) @ set.min.js?sxcver=8.9.1.13916:96
(anonymous) @ set.min.js?sxcver=8.9.1.13916:131
$eval @ set.min.js?sxcver=8.9.1.13916:145
$digest @ set.min.js?sxcver=8.9.1.13916:142
$apply @ set.min.js?sxcver=8.9.1.13916:146
(anonymous) @ set.min.js?sxcver=8.9.1.13916:276
Sf @ set.min.js?sxcver=8.9.1.13916:37
d @ set.min.js?sxcver=8.9.1.13916:37

DNN 事件日志中出现两个异常。每次保存失败时,它们都会出现两次。


General Exception
AbsoluteURL:/en-us/desktopmodules/2sxc/api/eav/entities/savemany
DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke
ExceptionGUID:7888b675-2f38-4664-96ab-786b27b3406c
AssemblyVersion:
PortalId:-1
UserId:-1
TabId:-1
RawUrl:
Referrer:
UserAgent:
ExceptionHash:QVy9pjR7G9IFD3vpE650/A==
Message:Error getting List of Stream. Stream Name: Default DataSource Name: QuickCache
StackTrace:
   at ToSic.Eav.DataSources.DataStream.get_LightList() in C:\Projects\eav-server\ToSic.Eav.DataSources\DataStream.cs:line 143
   at ToSic.Eav.DataSources.BaseDataSource.get_LightList() in C:\Projects\eav-server\ToSic.Eav.DataSources\BaseDataSource.cs:line 132
   at ToSic.Eav.Import.Import.RunImport(IEnumerable`1 newAttributeSets, IEnumerable`1 newEntities) in C:\Projects\eav-server\ToSic.Eav\ImportExport\Import.cs:line 71
   at ToSic.Eav.WebApi.EntitiesController.SaveMany(Int32 appId, List`1 items) in C:\Projects\eav-server\ToSic.Eav.WebApi\EntitiesController.cs:line 204
   at ToSic.SexyContent.EAVExtensions.EavApiProxies.EntitiesController.SaveMany(Int32 appId, List`1 items) in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\WebApi\EavApiProxies\EntitiesController.cs:line 109
   at lambda_method(Closure , Object , Object[] )
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.b__c(Object instance, Object[] methodParameters)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c__DisplayClass5.b__4()
   at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)
InnerMessage:An error occurred while executing the command definition. See the inner exception for details.
InnerStackTrace:
   at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
   at System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
   at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
   at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator()
   at ToSic.Eav.BLL.DbLoadIntoEavDataStructure.GetAppDataPackage(Int32[] entityIds, Int32 appId, IDeferredEntitiesList source, Boolean entitiesOnly) in C:\Projects\eav-server\ToSic.Eav\BLL\DbLoadIntoEavDataStructure.cs:line 179
   at ToSic.Eav.DataSources.SqlSources.EavSqlStore.GetDataForCache(IDeferredEntitiesList targetCacheForDeferredLookups) in C:\Projects\eav-server\ToSic.Eav\DataSources\SqlSources\EavSqlStore.cs:line 68
   at ToSic.Eav.DataSources.Caches.BaseCache.EnsureCache() in C:\Projects\eav-server\ToSic.Eav.DataSources\Caches\BaseCache.cs:line 126
   at ToSic.Eav.DataSources.Caches.BaseCache.GetList() in C:\Projects\eav-server\ToSic.Eav.DataSources\Caches\BaseCache.cs:line 46
   at ToSic.Eav.DataSources.DataStream.get_LightList() in C:\Projects\eav-server\ToSic.Eav.DataSources\DataStream.cs:line 135
Source:ToSic.Eav.DataSources
FileName:
FileLineNumber:0
FileColumnNumber:0
Method:

Page Load Exception
AbsoluteURL:/Default.aspx
DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke
ExceptionGUID:c5449323-0a0a-486f-98cd-9849243fff19
AssemblyVersion:7.4.2
PortalId:0
UserId:-1
TabId:56
RawUrl:/en-us/
Referrer:http://www.cui.edu/en-us/
UserAgent:Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13F69 Safari/601.1
ExceptionHash:301KQ/ilLzYrwILN4yfdXA==
Message:Error getting List of Stream. Stream Name: Default DataSource Name: PublishingFilter
StackTrace:
InnerMessage:Error getting List of Stream. Stream Name: Default DataSource Name: PublishingFilter
InnerStackTrace:
   at ToSic.Eav.DataSources.DataStream.get_List() in C:\Projects\eav-server\ToSic.Eav.DataSources\DataStream.cs:line 98
   at ToSic.Eav.DataSources.BaseDataSource.get_List() in C:\Projects\eav-server\ToSic.Eav.DataSources\BaseDataSource.cs:line 127
   at ToSic.SexyContent.ContentGroup.get_Template() in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\ContentGroup.cs:line 71
   at ToSic.SexyContent.ContentBlock.ModuleContentBlock..ctor(ModuleInfo moduleInfo, IEnumerable`1 overrideParams) in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\ContentBlock\ModuleContentBlock.cs:line 77
   at ToSic.SexyContent.View.get_SxcI() in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\View.ascx.cs:line 18
   at ToSic.SexyContent.View.get_UserMayEditThisModule() in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\View.ascx.cs:line 90
   at ToSic.SexyContent.View.Page_Load(Object sender, EventArgs e) in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\View.ascx.cs:line 28
   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Source:
FileName:
FileLineNumber:0
FileColumnNumber:0
Method:
4

1 回答 1

0

感谢 Raphael Müller,这个问题已经解决。他建议在数据库上重建索引。完成后,内容保存时间从 45 秒加上超时时间缩短到 1.5 秒。男孩是我的脸红。哦,生活和学习。教训很简单:确保您的数据库有一个包括重建索引的维护计划。

对于可能遇到此问题的人,这里有一些有用的链接。

这是一个重建数据库中所有索引的脚本。从理论上讲,脚本不应锁定您的数据库或网站,但一切皆有可能,因此最好在下班时间执行。在我大约 2.5 Gb 的 DNN 数据库上运行需要 5 分钟。https://gallery.technet.microsoft.com/scriptcenter/Script-for-rebuilding-all-8d079754

Michelle Ufford 的索引碎片整理脚本是一种高级解决方案。我已经在我的舞台服务器上成功运行了它,它似乎受到了社区的好评。http://sqlfool.com/2011/06/index-defrag-script-v4-1/

这是关于多久安排一次索引重建的有用讨论。应该多久在 sql-server DB 中重建索引?

于 2017-02-08T17:44:03.223 回答