Hi there,
While debugging a website of a partner of ours. We found some performance issues.. Please advice
You can't completely reproduce this by just visiting the website because it needs to perform a build
(with for example dirty web.config or updating Dynamicweb version).
1. It's a large project and GezondEnWel.Modules is the main entry. Update the
web.config (ApplicationUnit4\GezondEnWel.Webshop\Application) in with the correct connectionstring.
2a. Visit page productcategorie-26.aspx?GroupID=GROUP5&ParentGroupID=&ShowAll=True&ManufacturerID=SHOWALL&search=&dbstat=true.
2b. The problem specifically occurs when the solution is building (for example when updating the solution or making the web.config dirty). After the build data is cached and the problem is less of a problem.
2c. The thing is that multiple users are visiting the website also during build and this makes the website build for a long time and server cpu going through the roof.
3 The Dynamicweb Dbstats show you that there are basically three object that make multiple connections causing the slow build. For two of them we asked them to update their code.
3b. You can set a breakpoint here (ProductCatalogCategory.cs) to find mallfunction Dynamicweb method renderer.RenderProduct.
for (int j = 0; j < productAmountForCurrentRow; j++)
{
int productIndex = ItemsPerRow * i + j;
Product currentProduct = products[productIndex];
//render default tags
Renderer renderer = new Renderer();
renderer.RenderProduct(currentProduct, false, productItemTemplate);
renderer.RenderGroup(CurrentGroup, productItemTemplate);
//render custom tags
productItemTemplate.SetTag("Gw:ProductDetailPageId",ProductDetailPageId);
productItemTemplate.SetTag("Gw:ManufacturerId",QueryString.ManufacturerId);
productItemTemplate.SetTag("Gw:ParentGroupID",QueryString.ParentGroupId);
productItemTemplate.SetTag("Gw:Product.Image.Default.Clean",ImageHelper.GetCleanImagePath(currentProduct.Number));
productItemTemplate.CommitLoop();
}
4. My conslussion was that renderer.RenderProduct makes the supplied product
getDiscounts from the database resulting in multiple connections. You wouldn't
expect this behavior from a renderer, because you expect it to do as it has
been named meaning just rendering.
Greetz
Lucas