Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web.config production environment performance - Best practices

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.

For example :

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

So my question is :

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 ?

Thanks for your answers !

like image 737
malinois Avatar asked Oct 15 '25 14:10

malinois


1 Answers

In Web.Config you can configure whether you want debug assembles or release assemblies. You can tune the performance of WCF, thread pool. You can configure logging, etc.

Visual Studio doesn't change critical settings for you automatically. The only thing it does however is enable debug assemblies when you're trying to debug your app. It asks you for confirmation in that case. For production you can disable debug assemblies.

I would recommend you to use a diffmerge tool to see what sections are added since last commit. However please note that shorter config doesn't necessarily mean better performance.

Your web.config is merged with machine.config which has many sections. So not putting a section usually means you're not modifying the defaults in machine.config. Adding a section doesn't mean you're adding something new. It only means you're configuring something that will have otherwise some default setting.

As far as best practice is concerned. It is advisable to have a short config file to make it more maintainable. There is no point in specifying the defaults in the config again if they are implicitly default or are otherwise in machine.config anyway. VS2010 already avoids unnecessary sections.

like image 70
Muhammad Hasan Khan Avatar answered Oct 18 '25 08:10

Muhammad Hasan Khan