Share via


SiteLimits.MaxConnections Property

Definition

Gets or sets the maximum number of simultaneous connections to a server.

public:
 property long MaxConnections { long get(); void set(long value); };
public long MaxConnections { get; set; }
member this.MaxConnections : int64 with get, set
Public Property MaxConnections As Long

Property Value

A valid value from MinValue through MaxValue. The default is 4294967295.

Exceptions

The value is less than MinValue or greater than MaxValue.

Examples

The following example checks the value of the MaxConnections property. If the property value is less than 100, the example resets MaxConnections to 150. This code example is part of a larger example provided for the SiteLimits class.

// Check the maximum connections. If <100 reset to 150.
if (site.Limits.MaxConnections < 100)
{
    site.Limits.MaxConnections = 150;
    dirty = true;
}

Remarks

You can see and modify the MaxConnections property in the Advanced Settings dialog box in IIS Manager.

When you set the MaxConnections property, you need to call the Microsoft.Web.Administration.ServerManager.CommitChanges method to persist the change to the ApplicationHost.config file.

Applies to