开发者

Config file Performance question

开发者 https://www.devze.com 2023-01-31 15:20 出处:网络
I have around 60 web apps on web server, all of these app have some of the s开发者_运维知识库ame appsetting values in the web.config. These settings are loaded into memory as soon as the application s

I have around 60 web apps on web server, all of these app have some of the s开发者_运维知识库ame appsetting values in the web.config. These settings are loaded into memory as soon as the application starts. I would like to centralise these values in one config file for all apps to load.

My question is, if i load all of the apps up at the same time, would there be any performance issues accessing this same config file at the same time?

Cheers


Read locks are generally not exclusive so any number of applications can read from the same file at the same time. If you're not specifically requesting read exclusivity, you should be fine.

You should look at how you're loading the configuration file into each application.

See http://en.wikipedia.org/wiki/File_locking for more information.


Probably, because you need disk IO to access the file. But if the values stay in memory, I would say the performance issue would be minimal afterwards. Just be sure to read out the file without locking it (I believe with the FileShare.ReadWrite enum).


You might even see a small performance improvement since the file will be cached by the operation system when the first application reads the file, subsequent files will read directly from memory.

But the only way to know for sure is to measure and see.

0

精彩评论

暂无评论...
验证码 换一张
取 消