Web.config中的生产环境下的性能 - 最佳实践 [英] Web.config production environment performance - Best practices

查看:178
本文介绍了Web.config中的生产环境下的性能 - 最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio中,当我们开发,web.config文件经常修改,但我不知道是什么修改,什么都在生产envirionment性能的后果,而如果配置的部分是很重要的。

In Visual Studio, when we develop, the web.config file is often modified but I don't know what is modified, and what are consequences in production envirionment for performance, and if configurations sections are important.

例如:

<compilation>
<compilers>
<runtime>
...

有很多部分我认为都没有要领,没有它,或用另一种结构,可改善在生产环境性能

There are lot of sections I thinks are not essentials, and without it or with another configuration, can improve performance in production environment.

所以我的问题是:

什么是你在web.config文件中寻找生产环境不降低性能和具有光配置文件?

什么是最佳做法?

What are you looking for in web.config file in production environment to not to lower performance and have a light configuration file ?

What are best practices ?

谢谢您的回答!

推荐答案

部分在Web.config文件中的数字有无关,与业绩。

The number of sections in a web.config file has nothing to do with performance.

有些机器会要求才能运行相同的应用程序配置比别人(因此大小差异)更多的东西。

Some machines will require more things configured than others (hence a size difference) in order to run the same application.

由于哈桑指出,在web.config中被合并到计算机的配置文件。你很可能有1机(称为试验),它定义了一个未在生产配置中定义它的machine.config的事情。因此,对于测试,你可能不需要某些部分的生产需要。

As Hasan pointed out, the web.config is merged with the machines config file. You might very well have 1 machine (call it test) which defines things in it's machine.config that isn't defined in your production config. So, for test you might not need certain sections that production would require.

此外,机器的configs针对特定项目可能会有所不同。在Web场方案通常的做法是覆盖机配置文件具有共同的machineKey。这不会影响性能,但不会影响你是否会是成功的负载平衡的网站。

Also, the machine configs for a particular item might vary. In a web farm scenario it is common practice to override the machines config file with a common machinekey. This doesn't have a performance impact but does impact whether you are going to be successful in load balancing the site.

要迭代:在部分是不重要的性能。在内容来定义部分,在另一方面,是。

To iterate: the number of sections is immaterial to performance. The contents of defined sections, on the other hand, is.

现在,如何提高性能:这是由应用程序的基础的应用程序。对于生产,你会希望关闭调试,并打开之类的URL COM pression静态内容。

Now, how to improve performance: This is on an application by application basis. For production you will want to turn off debugging, and turn on things like url compression for static content.

您的也许的要打开COM pression动态内容以及甚至配置特定目录的通知浏览器的内容是可缓存的(如/图像/ CSS或JavaScript) 。顺便说一句,这些一般会增加您的生产配置文件的大小,并有一定的后果(如果你想改变一个CSS文件等),但通常会产生改善表现为客户端。

You might want to turn on compression for dynamic content as well or even configure certain directories to inform the browser that content is cachable (like /images, /css, or javascript). Incidentally, these would generally increase the size of your production config file and has certain consequences (like when you want to change a css file), but will generally yield improved performance for the client.

对于其它项目,你可能会关闭日志记录或使用完全不同的日志存储供应商。我们使用ELMAH和我们开发箱中的存储器存储配置而生产被配置为使用一个数据库服务器。不一定是性能问题,但可以肯定的关注之一。

For other items you might turn off logging or use a completely different logging storage provider. We use elmah and our dev boxes are configured for in memory storage whereas production is configured to use a database server. Not necessarily a performance issue, but certainly one of concern.

这里的要点是,一个配置文件应当用于确保该应用程序可以在特定的平台/机器上执行的目的

The point here is that a config file should be used for the purpose of making sure the application can execute on that particular platform / machine.

这篇关于Web.config中的生产环境下的性能 - 最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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