I'm currently writing an application that will automate several management items for our web-server. My question is simple but I can't find any documentation on it; when calling our ServerManager
through using Microsoft.Web.Administration
will it have any performance hindrance if the server object connection is periodically open and closed(disposed)?
I know in a SQL Database frequent connection calls can drain performance in a lot of cases; so I don't want to run into a similar problem.
I'm trying to avoid having to create an Instance
that will be Persisted
in a manner where outgoing task are queued then performed.
If anyone can let me know, and point me to any documentation on it that would be great. But like I said I can't find any at the moment.
An example on a small scale:
public void AddSite()
{
ServerManager defaultManager = new ServerManager();
// Perform Task
defaultManager.CommitChanges();
defaultManager.Dispose();
}
public void RemoveSite()
{
ServerManager defaultManager = new ServerManager();
// Perform Task
defaultManager.CommitChanges();
defaultManager.Dispose();
}
By essentially building the object based on each method; then closing it impact performance?
Update:
The example is a very basic and even primitive example. There will be some refactoring to adhere to good practice, like the implementation of a IDisposable
. However the main dilemma is I can not accurately depict the same variation like in SQL.
In SQL with excessive opening and closing, you see all the services gradually eat away performance especially as the database grows in complexity.
That is my goal with IIS, currently I can not obtain an accurate representation. The performance is indeed altering; I know most of the services it loads are also serializing and deserializing XML files that interpret the configuration.
Knowing how complex IIS is, with me automating it but trying to do the simplest path. I want to know if that simplistic approach may require a more complex approach or refactoring. As those services and process it does create do eat resources away.
I'm trying to accurately depict those possible hindrances, but I can't find any documentation or even details to Performance Gains for IIS.
Plus every time I do a test the results appear sporadic, inconsistent, and ultimately unreliable.