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.
8 years ago
Facing simillar problem using nopcommerce 3.6. Still dont find out the problem. During that time I do application pool recycle.
8 years ago
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);
}
8 years ago
Thanks for this Pete. I may put this in later, but the application pool is not restarting often.

I've come to the conclusion that it's database specific. I've backup/restored different database versions to the QA site and found that the dev is fast and the QA is slow. They don't have much in difference though. We have about 1600 product records. The database is 2.6GB total. The same as dev.

I have indexed the QA database and still the site is slow.
8 years ago
I found a culprit. I am using the plugin 301 redirect (https://www.nopcommerce.com/p/1044/301-page-redirect.aspx). I had about 1000 404 URLs in there. I deleted them, restarted the application pool and the site is fast again. I like the plugin. I will just need to keep the 404 down.
8 years ago
This is testing my memory a bit after six or so months.  I've since upgraded to 3.6 and I no longer have these problems but if memory serves me correctly it was our virtual server provider that had a problem.  I can't recall what it was now but I'm pretty sure that the nopCommerce problem went away once they solved their virtual server problem.
8 years ago
Our problem was this. Large amounts of spam hitting the production server at the same time. Clam Win was having to scan each email. Clamwin.exe was running 60-70 times in performance monitor on emails. Removed clamwin and haven't had 1 occurrence since. Clamwin is garbage dump it if your using it.
8 years ago
We have also found that if your using Azure for hosting the new SQL database tiers S0 to S3 are extremely under performing compared to the now retired business tier. We moved our database off of Azure SQL DB and are now running SQL Server right on the VM. Lightning fast. At $450 for P1 and $900 for P2 tiers respectively per month just too expensive to run Azure SQL DB to achieve the same performance as hosting SQL on the VM.
8 years ago
Has anyone found the true cause for the high CPU usage yet? My team has been working on this exact same issue for a couple weeks now. CPU usage will spike and lock the site up. It is always the same IIS worker process that is pegging the CPU. We have none of the previously mentioned plugins installed so I know that it is not truly those, at  least in out case. We are using a Virtual Server with GoDaddy that has 2 logical cores, 8GB Ram, Sql Server 2014 Express, Windows Server 2012, and Plesk 12.5.

We have certain kits that have many parts associated to them. Some SKU's have as many as twelve parts added. Worker Process seems to go crazy when trying to add more parts after about four or five. CPU usage will stay 80% or more for 5 to 10 minutes even after deleting the associations.

Installed Debug Diag 1.2 on the server and set up a trigger for CPU usage. The resulting report gave a list of the seven most CPU intensive threads that are being called when high CPU usage event is triggered. All of the threads it pulls are boilerplate system functions. The one exception is multiple calls for the InternalCase Method. I am not a programmer by any means but that sounds like a parsing operation. Could this be my issue? If so, how can that be fixed without doing core changes?

Thanks.
8 years ago
We believe we have and it depends upon which host your using, which mail server your using and which anti-virus software your using. For us the issue\is was Arvixe. After EIG purchased Arvixe two years ago we started receiving thousands of emails... a day. We have had Arvixe for 4 years. We did not have the issue for two years before the EIG merger. After the merger Arvixe told us we we're receiving all the spam because our DNS information was public but I set it up and I know darn well it wasn't. It is of my opinion that EIG is now selling your DNS info to email spammers. Even if your not on Arvixe you should be sure you are hosting on a reputable host of which we no longer consider Arvixe to be with all the issues we have had since the EIG merger. For us it was the spam coming in. Clamwin was scanning each email for viruses. Those spam emails came in blasts several hundred at a time. Arvixe does not give you a whole lot of memory to work with considering your running the Server 2008, SQL Server 2008, IIS and hmailserver all on the same machine. Even on their VPS servers which on a new account is 4GB. The problem for us was the scanning of the email messages used up all the ram forcing the Hard Disk to write to the disk thus using the CPU up as well. hmailserver also uses a catchall account which you should disable within hmailserver.

No memory = hard disk writes = cpu at 90-95% = website down.

We got rid of Clamwin, are running Microsoft Defender, which seems to run fine on Server 2008 R2 even though Microsoft says it doesn't, and haven't had a problem since.

For anyone using Arvixe you should be moving to another hose ASAP as we are in the process of doing. Nothing but major server issues and excuses from tech support, since the EIG buyout, and nowadays that's if you can even reach a tech support person at all. Arvixe no longer has 24/7 phone tech support. Even after submitting a support ticket you do not get in touch with a tech support person and if you need support on the weekends... LOL... forget it.
7 years ago
We are running 3.1 version on bare metal server. Recently we added ssl to all pages.

We started experiencing 99% percent usage randomly. No clue where to start and how to start catching the exception, causing this high usage.

We do have redirect rule on iis, forcing all connections without ssl to be 301 redirected to https version.
No other specifics.

There is nothing useful in windows logs, all schedulers run fine. No errors in nop log also.


Any idea?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.