﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - IIS taking 100% cpu during many minutes when having a lot of rows</title><link>http://www.intersoftsolutions.com/Community/WebGrid/IIS-taking-100-cpu-during-many-minutes-when-having-a-lot-of-rows/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>IIS taking 100% cpu during many minutes when having a lot of rows</title><link>http://www.intersoftsolutions.com/Community/WebGrid/IIS-taking-100-cpu-during-many-minutes-when-having-a-lot-of-rows/</link><pubDate>Tue, 26 May 2015 10:05:50 GMT</pubDate><dc:creator>leo.c</dc:creator><description>&lt;p&gt;Hi Alex,&lt;/p&gt;&lt;p&gt;I will try to help you by asking WebGrid development team whether this is possible. Will update you once I got the answer.&lt;/p&gt;&lt;p&gt;Best Regards,&lt;br&gt;Leo&lt;br&gt;&lt;/p&gt;</description></item><item><title>IIS taking 100% cpu during many minutes when having a lot of rows</title><link>http://www.intersoftsolutions.com/Community/WebGrid/IIS-taking-100-cpu-during-many-minutes-when-having-a-lot-of-rows/</link><pubDate>Mon, 25 May 2015 19:42:59 GMT</pubDate><dc:creator>aliard@sigma-rh.com</dc:creator><description>&lt;p&gt;Hi Leo,&lt;/p&gt;&lt;p&gt;I understand what you said but we also think that you could save a lot of CPU processing by not doing the indexOf every time you add a row in WebGridDataRowCollection. When we did the profiling of your code, this was causing such a CPU usage for many minutes we notices that 90% of the time is lost doing IndexOf.&lt;br&gt;&lt;br&gt;By changing this my 90 000 row will not be a problem anymore.&lt;/p&gt;&lt;p&gt;Can we at least try with a dirtybuild what I say in order to see if it works?&lt;/p&gt;&lt;p&gt;Regards,&lt;/p&gt;&lt;p&gt;Alex&lt;br&gt;&lt;/p&gt;</description></item><item><title>IIS taking 100% cpu during many minutes when having a lot of rows</title><link>http://www.intersoftsolutions.com/Community/WebGrid/IIS-taking-100-cpu-during-many-minutes-when-having-a-lot-of-rows/</link><pubDate>Fri, 08 May 2015 08:55:47 GMT</pubDate><dc:creator>leo.c</dc:creator><description>&lt;p&gt;Hi Alexandre,&lt;/p&gt;&lt;blockquote style="margin: 0px 0px 0px 5px; padding-left: 10px; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;"&gt;We cannot let the WebGrid hit directly the database in this case.&lt;/blockquote&gt;&lt;p&gt;For your information, WebGrid won't directly hit the database. After all the one that will handle all operation with database would be the datasource that has been used.&lt;/p&gt;&lt;p&gt;I would like to confirm whether&amp;nbsp;there really a need to display all 90 000 rows at once? After all, displaying such a large amount of data was not a good approach. The data should be chunk and feed it to webgrid which would be display to user. We typically suggest the developers to load data in server-side paged mode&amp;nbsp;which is&amp;nbsp;the best practice. &lt;/p&gt;&lt;p&gt;For your information, WebGrid actually&amp;nbsp;used standard data API from .NET, which is DataSet. And most operations are done through DataView. However, of course, if the data is not paged from server, then it'll be a lot in the web server. If you want to process the data in web server, you should try to process the data&amp;nbsp;then feed the final result to WebGrid (after the data was paged).&lt;/p&gt;&lt;p&gt;Best Regards,&lt;br&gt;Leo&lt;br&gt;&lt;/p&gt;</description></item><item><title>IIS taking 100% cpu during many minutes when having a lot of rows</title><link>http://www.intersoftsolutions.com/Community/WebGrid/IIS-taking-100-cpu-during-many-minutes-when-having-a-lot-of-rows/</link><pubDate>Thu, 07 May 2015 12:21:58 GMT</pubDate><dc:creator>aliard@sigma-rh.com</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;We cannot do what you suggest for many reason. One of the reason is that the datasource is manipulated in memory before being passed to the WebGrid. We cannot let the WebGrid hit directly the database in this case.&lt;/p&gt;&lt;p&gt;Our problem is related to a design flaw in the webgrid. A Collection is using an ArrayList which is exponetially non performant as it grow. We suggest that you use a different type of collection in order to improve globally the performance of your webgrid.&lt;/p&gt;&lt;p&gt;We also looked at the MSIL of WebGridColumnCollection.Add and found that a simple change could avoid making 90 000 IndexOf which should improve the performance.&lt;/p&gt;&lt;p&gt;In this method, you are doing the following in order to add a row only if it is not in the collection already:&lt;/p&gt;&lt;p&gt;if (this.indexOf(webGridColumn) == -1) then you add the row and set its .Collection property to this.&lt;/p&gt;&lt;p&gt;Instead of doing the indexOf you could only check if the collection is already equals to this, it would be way more efficient.&lt;/p&gt;&lt;p&gt;like this:&lt;br&gt;&lt;/p&gt;&lt;p&gt;if(webGridColumn.Collection != this) then you add the row.&lt;/p&gt;&lt;p&gt;We are kind of stuck with this problem and we see that there are easy way to fix it. Can we make an arrangement in order to test that in a dirty build or something with you ?&lt;/p&gt;&lt;p&gt;Regards,&lt;/p&gt;&lt;p&gt;Alex&lt;br&gt;&lt;/p&gt;</description></item><item><title>IIS taking 100% cpu during many minutes when having a lot of rows</title><link>http://www.intersoftsolutions.com/Community/WebGrid/IIS-taking-100-cpu-during-many-minutes-when-having-a-lot-of-rows/</link><pubDate>Thu, 07 May 2015 06:23:30 GMT</pubDate><dc:creator>leo.c</dc:creator><description>Hi Alexandre,&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;For your information, WebGrid has paging feature that could be used to handle a large mount of data. Enabling pagging will significantly boost your performance as user won't required to see all 90.000 data at once and server should only served the required data on the time user need it. So I suggest you to enable WebGrid's paging feature, either Classic Pagging or Virtual Load. And as addition,&amp;nbsp;&lt;span style="font-size: 10pt;"&gt;you use the ISLinqDataSource as the WebGrid data source&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;t&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;o get the maximum performance on server side. I hope this will help you.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Best Regards,&lt;br&gt;Leo&lt;/div&gt;</description></item><item><title>IIS taking 100% cpu during many minutes when having a lot of rows</title><link>http://www.intersoftsolutions.com/Community/WebGrid/IIS-taking-100-cpu-during-many-minutes-when-having-a-lot-of-rows/</link><pubDate>Wed, 06 May 2015 13:55:26 GMT</pubDate><dc:creator>aliard@sigma-rh.com</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;We have a grid with about 90,000 rows. It takes many minutes to show the page and during the page processing time, we noticed that w3wp.exe on the web server is taking all the available CPU.&lt;/p&gt;&lt;p&gt;We did some profiling in order to see where the problem was coming from and noticed that all the time is lost in WebGridRowCollection.Add doing Array.IndexOf. Is there a way for you to use HashTables or Dictionnary in this class instead? it would be more efficient for large data source.&lt;/p&gt;&lt;p&gt;See the attached png containing the Call Graph of the profing we did with Redgate Profiler.&lt;/p&gt;&lt;p&gt;Regards,&lt;/p&gt;&lt;p&gt;Alex&lt;br&gt;&lt;/p&gt;</description></item></channel></rss>