6

I need to do some performance tuning and need to modify the following settings: processModel, httpRuntime, and connectionManagement. Simple enough I suppose, but I'm not sure which of the two machine.config files to edit, or do I edit both?

  • \Windows\microsoft.net\ Framework \v2.0.50727\CONFIG\machine.config
  • \Windows\microsoft.net\ Framework64 \v2.0.50727\CONFIG\machine.config

As a follow up question, how do I verify that the settings have been applied?

I should mention that the server is running Windows Server 2003 Enterprise (64-bit) with IIS 6.0 (64-bit) and MSSQL Server Enterprise 2005 (64-bit).

Thanks for the help in advance!

John
  • 9,254
  • 12
  • 54
  • 75

2 Answers2

12

The one located in Framework64 is being used if your .net application/IIS is running in 64 bit mode. The other is used if running in 32 bit mode.

When bringing up the Windows Task Manager, if there's "*32" appended to the process name, then it runs in 32 bit. If not it runs under 64 bit.

If your OS is 64bit that is, something I assume since you have both folders on your machine.

If you are using IIS6/7, the process is named w3wp.exe.

IIS7 has more settings for this as well which can be read at this blog post.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Mikael Svenson
  • 39,181
  • 7
  • 73
  • 79
  • Looking at the Task Manager right now, I see "w3wp.exe". So does that mean I'm running IIS 7.0 and not 6.0 as I had thought? I also see "sqlservr.exe". Both processes do not have the "*32" suffix. However, I do see other procs that do have the "*32" suffix (i.e., "sqlbrowser.exe *32", "SqlWb.exe *32"). Any idea what that means? – John Jul 15 '10 at 15:33
  • By the way, I was using this article to determine which version of IIS is installed by default with Windows Server 2003: http://support.microsoft.com/kb/224609 – John Jul 15 '10 at 15:35
  • Both IIS6 and 7 are named w3wp. I edited this in my answer. And if w3wp is missing *32, they are running in 64 bit, and you should edit the machine.config in Framework64. – Mikael Svenson Jul 15 '10 at 16:17
  • Thanks Mikael! Ultimately, you answered my question my first question. Would you happen to be able to answer the second? Or do I trust that these settings are being used? – John Jul 19 '10 at 20:59
  • You should trust them, but connectionManagement should be easily tested by trying to open more than the specified number of connections to a host. – Mikael Svenson Jul 20 '10 at 06:22
3

Personally I would edit neither, but instead modify the web.config files at site or application level.

You should be able to modify httpRuntime and connectionManagement settings in this way, but not processModel, which can only be used in machine.config.

However you may not need to modify processModel if you are on Windows Server 2003.

As others have pointed out, if you do want to modify machine.config, IIS6 will run in 64-bit mode by default, so that's the version to edit. If you need to run in 32-bit mode (e.g. because you need to use 32-bit native DLLs), you can configure 32-bit mode as follows:

cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 "true"

See this TechNet article for more info.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Joe
  • 122,218
  • 32
  • 205
  • 338
  • Thanks for the tip Joe. I will be using web.config for all the above settings. – John Jul 19 '10 at 20:57
  • unless you want the settings to apply server-wide(for all sites). Then Machine.config is the appropriate location. – Demian Kasier Dec 31 '12 at 12:14
  • 1
    "unless you want the settings to apply server-wide(for all sites). Then Machine.config is the appropriate location. " - I'd still argue that putting it in the web.config of each site is better. Then the sites are self-contained, and you can move them to a different server without wondering why they suddenly stop working. – Joe May 14 '13 at 17:21
  • @joe I realize this is a super old comment, but sudden breaking if the app is moved across servers is exactly what I want to happen. – asawyer Oct 03 '13 at 17:19
  • @asawyer "breaking if the app is moved across servers is exactly what I want to happen" - not sure why you'd want that, but it's easy to achieve: e.g. just have an appSetting with the server name; when you start up compare it with Environment.MachineName and start ringing alarm bells if they don't match. – Joe Oct 03 '13 at 20:56