网站文件写性能问题

时间:2022-08-26 15:25:10

WE use a third party report tool. Report tool uses active-x. At first we generate and run a query accırding to filters, then one report file is created which inculdes the data (result of the query). Then client downloads the report file. But file written operation is a big problem for us. What can we do? Taking file written operations into another application and taking this application into another application pool can be a solution? Do you have any suggestion? And how the web server operates,runs? For example there are 100 clients which connects to web server and they are trying to run some reports. So web server must create 100 files for these clients. So if a report data is very huge and do others wait for its completion?

我们使用第三方报告工具。报告工具使用active-x。首先,我们生成并运行一个符合过滤器的查询,然后创建一个包含数据的报告文件(查询结果)。然后客户端下载报告文件。但文件写入操作对我们来说是个大问题。我们能做什么?将文件写入的操作带入另一个应用程序并将此应用程序带入另一个应用程序池可以解决方案你有什么建议吗? Web服务器如何运行,运行?例如,有100个客户端连接到Web服务器,他们正在尝试运行一些报告。因此,Web服务器必须为这些客户端创建100个文件。那么,如果报告数据非常庞大,其他人是否等待完成?

2 个解决方案

#1


Your problem is not very clear. You said writing file is a big problem, what do you mean by that? Is it slow or what?

你的问题不是很清楚。你说写文件是一个大问题,你的意思是什么?是慢还是什么?

Is your application designed to serve one client at a time? If not then why you saying others wait for its completion?

您的应用程序是否设计为一次为一个客户服务?如果没有,那你为什么说别人等完成呢?

I assume your application can serve multiple clients at a time. If the load is high writing of file will be affected as IO will slow down. You need to load balance the application where load gets divided between the instances and that way IO can be improved. Of course instances should be on different machines as the problem is of IO. There could be some other issues as well that the logic is CPU intensive as well as memory hungry. You need to profile your app to find all the issues.

我假设您的应用程序可以一次为多个客户端提供服务。如果负载很高,则文件写入将受到影响,因为IO将减慢速度。您需要对负载在实例之间划分的应用程序进行负载平衡,这样就可以改进IO。当然,实例应该在不同的机器上,因为问题在于IO。还可能存在一些其他问题,即逻辑是CPU密集型以及内存耗尽。您需要分析您的应用以查找所有问题。

#2


For large reports you can put the requests into a processing queue and have your customers wait a few minutes for it to be ready. Instant report generation for large data sets puts a lot of strain on your system, and is hard to load balance.

对于大型报表,您可以将请求放入处理队列中,让客户等待几分钟以使其准备就绪。大数据集的即时报告生成会给您的系统带来很大压力,并且很难实现负载平衡。

Perhaps have your web site forward requests to a queue that will eventually be processed by separate report generating servers. You can add more of these servers to process items in the queue, and this processing will not affect the website users, they will just have to live with reports not being instant.

也许您的网站将请求转发到队列,最终将由单独的报告生成服务器处理。您可以添加更多这些服务器来处理队列中的项目,并且此处理不会影响网站用户,他们只需要处理报告不是即时的。

Also think of processing that you can do before hand so that all the processing isn't 'on demand'. If they have the same reports every day, allow it to be scheduled, so your clients don't feel like they are waiting too long for reports.

还要考虑一下您可以事先进行的处理,以便所有处理都不是“按需”。如果他们每天都有相同的报告,请允许它进行安排,这样您的客户就不会觉得他们等待报告的时间太长。

Heavy IO should be offloaded to servers that are not processing client web requests.

应将重IO卸载到不处理客户端Web请求的服务器。

#1


Your problem is not very clear. You said writing file is a big problem, what do you mean by that? Is it slow or what?

你的问题不是很清楚。你说写文件是一个大问题,你的意思是什么?是慢还是什么?

Is your application designed to serve one client at a time? If not then why you saying others wait for its completion?

您的应用程序是否设计为一次为一个客户服务?如果没有,那你为什么说别人等完成呢?

I assume your application can serve multiple clients at a time. If the load is high writing of file will be affected as IO will slow down. You need to load balance the application where load gets divided between the instances and that way IO can be improved. Of course instances should be on different machines as the problem is of IO. There could be some other issues as well that the logic is CPU intensive as well as memory hungry. You need to profile your app to find all the issues.

我假设您的应用程序可以一次为多个客户端提供服务。如果负载很高,则文件写入将受到影响,因为IO将减慢速度。您需要对负载在实例之间划分的应用程序进行负载平衡,这样就可以改进IO。当然,实例应该在不同的机器上,因为问题在于IO。还可能存在一些其他问题,即逻辑是CPU密集型以及内存耗尽。您需要分析您的应用以查找所有问题。

#2


For large reports you can put the requests into a processing queue and have your customers wait a few minutes for it to be ready. Instant report generation for large data sets puts a lot of strain on your system, and is hard to load balance.

对于大型报表,您可以将请求放入处理队列中,让客户等待几分钟以使其准备就绪。大数据集的即时报告生成会给您的系统带来很大压力,并且很难实现负载平衡。

Perhaps have your web site forward requests to a queue that will eventually be processed by separate report generating servers. You can add more of these servers to process items in the queue, and this processing will not affect the website users, they will just have to live with reports not being instant.

也许您的网站将请求转发到队列,最终将由单独的报告生成服务器处理。您可以添加更多这些服务器来处理队列中的项目,并且此处理不会影响网站用户,他们只需要处理报告不是即时的。

Also think of processing that you can do before hand so that all the processing isn't 'on demand'. If they have the same reports every day, allow it to be scheduled, so your clients don't feel like they are waiting too long for reports.

还要考虑一下您可以事先进行的处理,以便所有处理都不是“按需”。如果他们每天都有相同的报告,请允许它进行安排,这样您的客户就不会觉得他们等待报告的时间太长。

Heavy IO should be offloaded to servers that are not processing client web requests.

应将重IO卸载到不处理客户端Web请求的服务器。