100% CPU usage on home page load

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago
Hi
I have nopcommerce 3.2 and have a dedicated server which is raid3 runing Windows2012, sql server 2012 in a Virtual box, Iwould say it is pretty much brand new server has 16GB RAM..etc.

I have 130,000 + products and heaps of categories in my database will grow more.

My problem is home page never loads. CPU going the max.

Please let me know how to improve this.

It is a great help.

Thanks
9 years ago
I experienced same issue with nop 3.2, now resolved everything works fine for me

Here is the steps you can follow

1. Make sure that you execute App_Data/SqlServer.Indexes.sql for indexing
2. For now , uninstall /disable all third party plugins ( if you installed some)
3.  Find Most Expensive Queries Using DMV

SELECT TOP 10 SUBSTRING(qt.TEXT, (qs.statement_start_offset/2)+1,
((CASE qs.statement_end_offset
WHEN -1 THEN DATALENGTH(qt.TEXT)
ELSE qs.statement_end_offset
END - qs.statement_start_offset)/2)+1),
qs.execution_count,
qs.total_logical_reads, qs.last_logical_reads,
qs.total_logical_writes, qs.last_logical_writes,
qs.total_worker_time,
qs.last_worker_time,
qs.total_elapsed_time/1000000 total_elapsed_time_in_S,
qs.last_elapsed_time/1000000 last_elapsed_time_in_S,
qs.last_execution_time,
qp.query_plan
FROM sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) qt
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) qp
ORDER BY qs.total_logical_reads DESC -- logical reads
-- ORDER BY qs.total_logical_writes DESC -- logical writes
-- ORDER BY qs.total_worker_time DESC -- CPU time


( http://blog.sqlauthority.com/2010/05/14/sql-server-find-most-expensive-queries-using-dmv/ )

And fix it

4. For your case I recommend  virtual dedicated server CPU 2.8 GHz ( 8 CPU )  

5. Still not fixed?
Put output cache on some common controller actions

// Catalog controller
[ChildActionOnly, OutputCache(Duration = 3600, VaryByCustom = "FlushKey")]
        public ActionResult HomepageProducts()

   [ChildActionOnly, OutputCache(Duration = 3600, VaryByCustom = "FlushKey")]
        public ActionResult HomepageBestSellers()
....
  [ChildActionOnly, OutputCache(Duration = 3600, VaryByCustom = "FlushKey")]
        public ActionResult HomepageCategories()
...
[ChildActionOnly, OutputCache(Duration = 8000, VaryByCustom = "FlushKey")]
        public ActionResult TopMenu()
....
  [ChildActionOnly, OutputCache(Duration = 3600, VaryByParam = "*", VaryByCustom = "FlushKey")]
        public ActionResult CategoryNavigation(int currentCategoryId, int currentProductId)

  [ChildActionOnly, OutputCache(Duration = 3600, VaryByParam = "*", VaryByCustom = "FlushKey")]
        public ActionResult TopicBlock .... in Topic controller



You can do same for

Make sure your that you flush the output cache when necessary  see here
[url] http://stackoverflow.com/questions/565239/any-way-to-clear-flush-remove-outputcache [/url]

best of luck
9 years ago
Thank you very much I will get on with it.
9 years ago
Consider upgrading to 3.40 - many performance improvements.
9 years ago
bandulaperera wrote:
Hi
I have nopcommerce 3.2 and have a dedicated server which is raid3 runing Windows2012, sql server 2012 in a Virtual box, Iwould say it is pretty much brand new server has 16GB RAM..etc.

I have 130,000 + products and heaps of categories in my database will grow more.

My problem is home page never loads. CPU going the max.

Please let me know how to improve this.

It is a great help.

Thanks


Hi,

May be you should check that you don't have too many products displayed on the home page!

One of our client had faced same issue and after few hours we figured out that by mistake he choose to display all products on home page from his database of of appx. 100k + database while importing products using SQL query.

I would also advise you to upgrade to the latest version of nopCommerce which is significantly faster than the version you're using currently.

Regards
9 years ago
Sorry, posted on wrong forum. Deleted.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.