Nop 3.1 High Memory and CPU usage. Arvixe claiming website code.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
hemilis wrote:
On our 3.9 site Everleap shut us down because the site was consuming too many resources on the sql server. If your web site and database are on the same machine, do take the time to see if sql server is running up a big ticket. Specifically when populating category pages built from a query.


I would like to add that you should always have capping on max RAM your SQL Server can use if you're having app & db on same server.
3 years ago
petemitch wrote:
This might be useful to anyone that's experiencing unexpected application restarts. Add the code below to the site's Global.asax file and whenever the site shuts down or restarts the reason will be logged in the nopCommerce log. It also adds an entry to windows event log so if the site is stuck in a restart loop and you can't get to the nop log page you possibly still see what's causing it.

It's based on code in this Scott Gu blog post, just with the nop logging added: http://weblogs.asp.net/scottgu/433194

Add these usings:

using Nop.Core.Domain.Logging;
using System.Diagnostics;
using System.Reflection;


Add the Application_End() event:

protected void Application_End()
{
    HttpRuntime runtime = (HttpRuntime)typeof(System.Web.HttpRuntime).InvokeMember("_theRuntime", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.GetField, null, null, null);

    if (runtime == null)
        return;

    string shutDownMessage = (string)runtime.GetType().InvokeMember("_shutDownMessage", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField, null, runtime, null);

    string shutDownStack = (string)runtime.GetType().InvokeMember("_shutDownStack", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField, null, runtime, null);


    if (!EventLog.SourceExists(".NET Runtime"))
    {
        EventLog.CreateEventSource(".NET Runtime", "Application");
    }

    EventLog log = new EventLog();
    log.Source = ".NET Runtime";
    log.WriteEntry(String.Format("\r\n\r\n_shutDownMessage={0}\r\n\r\n_shutDownStack={1}",
                                    shutDownMessage,
                                    shutDownStack),
                                    EventLogEntryType.Error);
            
    //log
    var logger = EngineContext.Current.Resolve<ILogger>();

    logger.InsertLog(LogLevel.Information,
                     "Application end",
                     String.Format("_shutDownMessage={0}\r\n\r\n_shutDownStack={1}",
                                    shutDownMessage,
                                    shutDownStack),
                     null);
}


Since Net Core doesnt have this global.asax then what is the updated code for this and where to place it?
2 years ago
We have the same problem and by the way the reason was pretty silly. Because old NopCommerce platform do not support anymore Captcha we realized that some of our news or blog has more than 30000 comments in it made by bots. To load one of this pages it requires more than a minute for a single request. Go and review all comments and posts and you will realize that this make the application pool too huge and enormus.

For more information to debug see this article:

https://stackify.com/w3wp-high-cpu-usage/
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.