Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy ASP.net Website taking High CPU with just few visitors?
    primarykey
    data
    text
    <p>We are working on shopping cart website with more than 1 lakh products, made on the top of popular e-commerce application - NopCommerce version 2.3 (Just to introduce you to NopCommerce - It's a one of the best &amp; popular open source e-commerce application built on the top of ASP.net version 4 and MVC3.). The site was published with two langauages and single currency.</p> <p>With around 80 category and 30-40k products it works fairly well. I mean not very bad. But it wasn't good either. As soon as more products were added, performance issues were started with symptoms like long response time (more than 40-50 seconds to load) and high CPU usage (utilizing 90-100%) with just 10-20 users.</p> <p>The server is Quad Core Xeon Processor with 16 GB of RAM - Windows Server 2008 R2, and is working fine with one more e-commerce website with 50k products on custom develop code - taking hardly 4-8% cpu.</p> <p>We used cache to store home page featured products and category menu in memory to avoid db calls. It improved home page only.</p> <p>Later on for fixing issue, we profiled and found that it was Catalog listing which was causing lot of delay to fetch data from the db, which is finely normalized. SQL server seems to take 80-90% CPU and w3wp were taking 30-40% cpu which is causing 100% cpu constantly all the time with just few visitors on website. We consulted few expert, they suggested us to store de-normalized data on disk in binary format to bypass expensive database connections. We did some research and used Protobuff to store de-normalized serialized objects data to the disk which is storing only those fields which are necessary for catalog - product listing page. But due to maintaing some specification functionality we used to create 3 binary file. One for product object, another for category specification object. These two files are per category. And one more file for product and specification mapping - taking almost 5 mb. When requests come, it reads from the serialized binary file and returns data to the object. It reads into mapping file only when someone is filtering the product based on specification.</p> <p>So now whenever a request for catagory product listing page comes, it checks whether there is binary file created for that category, if it doesn't it generates using stored procedure, and save object to binary for later use. If file exists it directly reads it from binary file. With this thing, we avoided 90% of db calls while loading this page. With just few users (appx. 30-40), it works like a charm. And we are able to reduce the response time to 700-800 ms for each page load. This is a great improvement if we look at the loading time, but CPU is still on the higher side. Differece is: now w3wp using 60-70% cpu with 20-30 visitors and sql is hardly using 5-8%.</p> <p>But with hitting more users appx to 100-120, servers starts to hang and w3wp is using more than 100% constantly. Requests are no longer served in seconds, instead it takes more than 20-25 seconds to load. And then most requests are never served. We noticed this when multiple request are coming to the site.</p> <p>We're not expert at Serialization and Binary formater. But we think the high cpu usage is caused by file read operation or may be due to the de-serialization operation being performed on each catalog page load.</p> <p>We're now looking at the probable solution to address High CPU usage. What could be the problem, and where should we look to fix it. What do you think, is it the file read operation or de-serialization causing this? Should we store de-normalized object in db? What are the alternative we have to address this issue?</p> <p>Awaiting your expert opinion on the same.</p> <p>Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload