如何在加载仪表板时减轻服务器的负担 [英] How to reduce the burden on the server while loading the dashboard

查看:50
本文介绍了如何在加载仪表板时减轻服务器的负担的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我使用devexpress和MVC在仪表板应用程序上创建。



装载仪表板需要将近10分钟。



我创建数据提取以压缩sql数据源并将其分配给仪表板数据源。



在更新仪表板时,我在global.asax.cs中编写了一个方法。



我的服务器上有22万条记录。 。



检索记录时需要花费更多时间。



如何提高性能?网站减轻了服务器的负担?



这里我使用的是java脚本。



建议我是一个解决方案。



谢谢。



我尝试过:



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:

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) { }
        }

推荐答案

您正在从XML文件加载超过2.2百万行数据。我可以想象一下这些XML文件的大小。更不用说将它们加载到内存中并呈现UI。像F-ES一样,想想用户将如何看待和使用这些数据。人眼和大脑只能在给定时间处理如此多的数据。以较小的块加载数据,使用分页,回访用户。如果他们告诉你他们需要一次加载所有220万行数据,99%确定他们不需要一次加载所有行。



如果你有如果可以,访问数据源不使用XML文件。直接阅读数据库。
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.


您好,



我想创建一个Windows服务来每天或每小时更新数据提取基础。



请你建议我实现这个的方法。



装货时调用Windows服务可能需要一段时间,它不会显示准确的数据。



如何将此方法传递给我的服务。



谢谢。
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.


这篇关于如何在加载仪表板时减轻服务器的负担的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆