Performance - could varnish cache be a solution?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago
Hello,

We are using nopCommerce 3.4, but we are still having problems with performance. Currently the average load time according to Google Analytics is over 5sec which simply is too much. We have a goal to perform (in average) below 2.9 sec.

I have been looking at Varnish cache to try and solve our problem (https://www.varnish-cache.org/). Anyone having experience from this? Any thoughts are welcome!!! (Also tips on how to make the original nopCommerce perform better...)

We are already using nopAccelerate which helps a bit, but they cannot help with i.e. time for initial redirect for language seo.

Greetings
/Johan Davidsson
http://www.gerdmans.se
9 years ago
1. You can try output cache on some common controller actions

// Product controller and 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 product list category list, manufacturer list

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

2.  
Find Most Expensive Queries Using DMV and use suggested indexing

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

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


Similar post
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.