Click here to Skip to main content
15,889,879 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,

I have created on dashboard application using devexpress and MVC.

On loading the dashboard it takes nearly 10 minutes.

SO I created data extracts to compress sql data source and assigned it to dashboard data source.

On updating the dashboard I have written one method in global.asax.cs.

There are 22 lakhs records fetching to my server..

While retrieving that records it is taking more time.

How should i increase performance of the website by reducing the burden on the server?

Here I am using java script.

Please suggest me a solution.

Thank you.

What I have tried:

C#
protected void UpdateExtract(string dashboardId)
        {
            try
            {
                using (Dashboard newDashboard = new Dashboard())
                {
                    using(Dashboard Dashboard1=new Dashboard())
                    {
                        newDashboard.LoadFromXml(Server.MapPath(string.Format(@"~/App_Data/Dashboards/{0}.xml", dashboardId)));
                        Dashboard1.LoadFromXml(Server.MapPath(string.Format(@"~/App_Data/Dashboards/SQL/{0}.xml", dashboardId)));
                        var dataSour = Dashboard1.DataSources.OfType<DashboardSqlDataSource>().ToArray();
                        //DashboardSqlDataSource extractDataSource = new DashboardSqlDataSource();
                        foreach (DashboardSqlDataSource datr in dataSour)
                        {
                            datr.Fill();
                        }
                        var dataSources = newDashboard.DataSources.OfType<DashboardExtractDataSource>().ToArray();
                        foreach (DashboardExtractDataSource dataSource in dataSources)
                        {
                            dataSource.ExtractSourceOptions.DataSource = dataSour[0];
                            dataSource.UpdateExtractFile();
                        }
                    }
                  
                }
            }
            catch (Exception Ex) { }
        }
Posted
Updated 1-Jun-17 19:46pm
Comments
F-ES Sitecore 31-May-17 11:56am    
Re-architect your system so that it doesn't load so much data up-front. Load a minimal amount of data and load the rest via ajax, preferably using paging or at least loading the data in chunks to again minimise the work done at each stage, but ultimately you need to think about what data the user actually needs and rather than load everything load the mininum and load everything else on demand.

You are loading over 2.2 millions rows of data from an XML file. I can just imagine the size of those XML files. Let alone loading them into memory and rendering the UI. Like F-ES said think about how a user will look at and use this data. The human eye and mind can only process so much data at a given time. Load the data in smaller chunks, use paging, go back a talk to the users. If they tell you they need all 2.2 million rows of data loaded at once 99% sure they don't need all the rows loaded at once.

Also if you have access to the data source don't use XML files if you can. Read directly against the db.
 
Share this answer
 
Comments
[no name] 31-May-17 12:55pm    
"loading them into Memory" and parse it ... A 5
Hi,

I want to create a windows service to update the data extract daily or hourly basis.

Would you please suggest me the ways to implement this.

At the time of loading calling a windows service may take sometime and it will not show accurate data.

How can i pass this method to my service.

Thank you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900