为多个实例构建C#控制台应用程序 [英] Building C# console app for multiple instances

查看:66
本文介绍了为多个实例构建C#控制台应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个将数据导入数据库的控制台应用程序。这将每小时运行一次,具体取决于输入的CSV文件。该应用程序还需要重用于同一服务器上的其他数据库导入,例如最多可以有20个同一个.exe文件实例,每个实例具有各自独立的配置。

I'm building a console application which imports data into databases. This is to run every hour depending on an input CSV file being present. The application also needs to be reused for other database imports on the same server, e.g. there could be up to 20 instances of the same .exe file with each instance having their own separate configuration.

目前,我拥有基础应用程序,该应用程序可以传递位置为通过args配置文件,因此可以根据哪个应用程序需要使用它进行调整。

At the moment I have the base application which passes a location of config file via args, so it can be tweaked depending on which application needs to use it. It also undertakes the import via a transaction, which all works fine.

我担心在同一个盒子上运行20个相同的.exe文件实例,每个实例小时,可能导致CPU耗尽?

I'm concerned that having 20 instances of the same .exe file running on the same box, every hour, may cause the CPU to max out?

我该怎么解决?

推荐答案

为什么不制作一个可以处理多种配置的实例?似乎易于维护和控制。

Why not make a single instance that can handle multiple configurations? Seems a lot easier to maintain and control.

这篇关于为多个实例构建C#控制台应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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