nopCommerce 1.7 cache not working?! Possible solution to 1.7 slowness?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
nopCommerce team | a.m. wrote:
i

BTW I think solution pre-generating views will significantly improve performance of Entity Framwork. You can find more info here and here.

"However, the downside of this solution is the need to keep the generated views synchronized with changes to the model" - that's why we'll not follow this solution into official releases


Just tried to do this, but nop breaks after doing so. Error:
Server Error in '/' Application.
Unable to load the specified metadata resource.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.MetadataException: Unable to load the specified metadata resource.

Source Error:

Line 75:         /// </summary>
Line 76:         /// <param name="connectionString">Connection String</param>
Line 77:         public NopObjectContext(string connectionString)
Line 78:             : base(connectionString, "NopEntities")
Line 79:         {
Source File:  C:\Users\Will\Documents\Visual Studio 2010\Projects\proj\Libraries\Nop.BusinessLogic\Data\NopObjectContext.cs    Line:  77

Stack Trace:

[MetadataException: Unable to load the specified metadata resource.]
   System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.LoadResources(String assemblyName, String resourceName, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver) +2490148
   System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.CreateResourceLoader(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver) +170
   System.Data.Metadata.Edm.MetadataArtifactLoader.Create(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver) +8517824
   System.Data.Metadata.Edm.MetadataCache.SplitPaths(String paths) +271
   System.Data.Common.Utils.<>c__DisplayClass2.<Evaluate>b__0() +19
   System.Data.Common.Utils.Result.GetValue() +100
   System.Data.Common.Utils.Memoizer`2.Evaluate(TArg arg) +181
   System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections) +292
   System.Data.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection() +29
   System.Data.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor) +205
   System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName) +27
   NopSolutions.NopCommerce.BusinessLogic.Data.NopObjectContext..ctor(String connectionString) in C:\Users\Will\Documents\Visual Studio 2010\Projects\proj\Libraries\Nop.BusinessLogic\Data\NopObjectContext.cs:77

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct& signature, RuntimeType declaringType) +0
   System.RuntimeMethodHandle.InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct signature, RuntimeType declaringType) +15
   System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +281
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1136
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111
   System.Activator.CreateInstance(Type type, Object[] args) +19
   NopSolutions.NopCommerce.BusinessLogic.Data.AspNetObjectContextManager`1.get_ObjectContext() in C:\Users\Will\Documents\Visual Studio 2010\Projects\proj\Libraries\Nop.BusinessLogic\Data\AspNetObjectContextManager.cs:53
   NopSolutions.NopCommerce.BusinessLogic.Data.ObjectContextHelper.get_CurrentObjectContext() in C:\Users\Will\Documents\Visual Studio 2010\Projects\proj\Libraries\Nop.BusinessLogic\Data\ObjectContextHelper.cs:53
   NopSolutions.NopCommerce.BusinessLogic.Configuration.Settings.SettingManager.GetAllSettings() in C:\Users\Will\Documents\Visual Studio 2010\Projects\proj\Libraries\Nop.BusinessLogic\Configuration\Settings\SettingManager.cs:92
   NopSolutions.NopCommerce.BusinessLogic.Configuration.Settings.SettingManager.GetSettingByName(String name) in C:\Users\Will\Documents\Visual Studio 2010\Projects\proj\Libraries\Nop.BusinessLogic\Configuration\Settings\SettingManager.cs:348
   NopSolutions.NopCommerce.BusinessLogic.Configuration.Settings.SettingManager.GetSettingValue(String name) in C:\Users\Will\Documents\Visual Studio 2010\Projects\proj\Libraries\Nop.BusinessLogic\Configuration\Settings\SettingManager.cs:314
   NopSolutions.NopCommerce.BusinessLogic.Configuration.Settings.SettingManager.GetSettingValueBoolean(String name, Boolean defaultValue) in C:\Users\Will\Documents\Visual Studio 2010\Projects\proj\Libraries\Nop.BusinessLogic\Configuration\Settings\SettingManager.cs:247
   NopSolutions.NopCommerce.BusinessLogic.Configuration.Settings.SettingManager.GetSettingValueBoolean(String name) in C:\Users\Will\Documents\Visual Studio 2010\Projects\proj\Libraries\Nop.BusinessLogic\Configuration\Settings\SettingManager.cs:236
   NopSolutions.NopCommerce.BusinessLogic.Directory.LanguageManager.get_CacheEnabled() in C:\Users\Will\Documents\Visual Studio 2010\Projects\proj\Libraries\Nop.BusinessLogic\Directory\LanguageManager.cs:217
   NopSolutions.NopCommerce.BusinessLogic.Directory.LanguageManager.GetAllLanguages(Boolean showHidden) in C:\Users\Will\Documents\Visual Studio 2010\Projects\proj\Libraries\Nop.BusinessLogic\Directory\LanguageManager.cs:84
   NopSolutions.NopCommerce.BusinessLogic.NopContext.get_WorkingLanguage() in C:\Users\Will\Documents\Visual Studio 2010\Projects\proj\Libraries\Nop.BusinessLogic\NopContext.cs:366
   NopSolutions.NopCommerce.HttpModules.MembershipHttpModule.Application_BeginRequest(Object sender, EventArgs e) in C:\Users\Will\Documents\Visual Studio 2010\Projects\proj\Libraries\Nop.HttpModules.MembershipModule\MembershipHttpModule.cs:164
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

13 years ago
A better caching solution for the Entity Framework - http://bit.ly/cfM5pu
13 years ago
nopCommerce team | retroviz wrote:
A better caching solution for the Entity Framework - http://bit.ly/cfM5pu


Just come across this too: http://code.msdn.microsoft.com/EFProviderWrappers

Is Nop moving to MVC?

What are the plans for future caching methods?

Something has to be done, Google has said time and time again speed is king so this should be a focus.
13 years ago
Doubt nopCommerce will move to MVC,

That link discusses a good caching solution that can be used Entity Framework - it's not specific to MVC.

Also see my solution at https://www.nopcommerce.com/boards/t/6170/administration-performance-better-paging-solution.aspx for better paging performance.
13 years ago
nopCommerce team | retroviz wrote:
Doubt nopCommerce will move to MVC,

That link discusses a good caching solution that can be used Entity Framework - it's not specific to MVC.


the link you sent me just uses a similar caching method to how nopCommerce used to work.

What i am struggling with is I haven't had a straight answer as to why caching was moved per request instead of in memory.
13 years ago
Yes it is similar (apart from now using System.Runtime.Caching - new in .NET 4) and a nice way of getting invalidated cache items.

Can't tell you why httpcontext was used for caching items - not my decision i'm afraid. It's okay for short lived items but do think we need to reinstate the memory cache to improve performance.
13 years ago
nopCommerce team | retroviz wrote:
Yes it is similar (apart from now using System.Runtime.Caching - new in .NET 4) and a nice way of getting invalidated cache items.

Can't tell you why httpcontext was used for caching items - not my decision i'm afraid. It's okay for short lived items but do think we need to reinstate the memory cache to improve performance.


that's refreshing to hear.

Issues I have found:

1) Page load is seriously effected. The time to first server response can be 0.5 to 1 second. This should be instant.
2) Scripts such as Google Base provider, product export etc all timeout using httpcontext caching method because of the delay of getting the data from the database. I have a server with 8CPU cores, 16GB of ram and it still struggles with only a couple of busyish sites.

.NET has the advantage over PHP and other scripting languages of being compiled. The fact that nopCommerce has broken one of the main features of .NET (speed) makes me want to weep! :)

I am going to spend tonight putting caching back to the way it was and I will see if I get the errors mentioned earlier.

Please retroviz, if you get a chance please suggest  putting it back :)
13 years ago
is it possible to get good speeds with NopCommerce 1.7? I'm experiencing 3-4 seconds for default.aspx on good VPS. It's a multilanguage site (3) with 1 product. Somethings needs to be done. Will upgrading to 1.8 solve anything I should I downgrade to 1.6? Any ideas how to fix caching?
13 years ago
http://nopcommerce.codeplex.com/workitem/9445

vote here for this.
13 years ago
Hi there,

I absolutley disagree using the cache per request. There might be some exclusions for data that is updated very frequently, that is alright, but not for stuff like searchresults or product details.

I'm too am a bit dissapointed that most of the stuff has moved to the NopRequestCache.
10 User hit one page wich generates 40 queries. => 400 rqueries in total for just 10 users.


It would be good to have this configurable. Have a common interface for NopRequestCache and NopStaticCache like INopCache object.
In methods like GetCategoryById() you would deal with the INopCache object. where you add, remove objects.

The underlying logic which cache type is to be returned would be done by a FactoryMethod, where you could place even more config options.
This shouldn't be that complicated and extensible.
As for exceptions.
We are talking here only about the front end, not the administration part.
When all objects are detached from the ObjectContext, I can't see how you would get any exceptions?
I changed all the search results to come from a single aggregated table, which results in turn are fully cached as well. There are over 20.000 products in there and I never had one exception and it is very fast. Unfortunately I have now even more queris as stuff moved from Static to Request. Hm

My thought,
Deval
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.