0/0 | |
|
I've been using the DAAB for sometime and the other
day I migrated my project to the TES server. Upon doing so, I noticed
some strange performace issues with my web application, so I decided to
create two simple web applications, one which uses the DAAB, and the
other which uses regular ADO.Net. The purpose of these applications was
so that I could stress test them using the Microsoft Application Center
Test (ACT).
Both of these applications are very simple, they call a stored proc and
cycle through the results to display them on the page, below is the
code:
DAAB Application:
public class WebForm1 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
Database dbMCS = DatabaseFactory.CreateDatabase();
DBCommandWrapper sp = dbMCS.GetStoredProcCommandWrapper("spMenuGM02");
IDataReader reader = reader = dbMCS.ExecuteReader(sp);
while (reader.Read())
{
Response.Write (reader.GetString(4));
Response.Write ("<br>");
}
reader.Close();
}
}
ADO.Net Application:
public class WebForm1 : System.Web.UI.Page
{
SqlDataReader rdr = null;
SqlConnection con = null;
SqlCommand cmd = null;
private void Page_Load(object sender, System.EventArgs e)
{
string ConnectionString = dbConnectionString;
con = new SqlConnection(ConnectionString);
con.Open();
cmd = new SqlCommand("spMenuGM02");
cmd.Connection = con;
rdr = cmd.ExecuteReader();
while (rdr.Read())
{
Response.Write (rdr.GetString(4));
Response.Write ("<br>");
}
rdr.Close();
cmd.Connection.Close();
con.Close();
}
}
So
as you can see, both of these applications are failry straight forward
and nothing complex, however, when i test these applications through
the ACT software, the DAAB version simply just breaks down, where as
the regulare ADO.Net version achieves a respectable 515 succusfull
requests per second with NO HTTP errors.
Both of these tests were configured for 100 simultanouse client connections running for a period of 1 minute.
For the ADO.Net application:
Response Codes |
|
|
|
|
Response Code: 200 - The request completed
successfully. |
|
|
Count: |
28,589 |
|
|
Percent (%): |
100.00 |
For the DAAB application:
Response Codes |
|
|
|
|
Response Code: 500 - The server encountered an
unexpected condition that prevented it from fulfilling the request. |
|
|
Count: |
143 |
|
|
Percent (%): |
8.77 |
|
|
Response Code: 200 - The request completed
successfully. |
|
|
Count: |
1,487 |
|
|
Percent (%): |
91.23 |
So as you can see, a lot more errors for the DAAB application.
I then investigated this a little further and noticed that there were hundreds of errors logged in the event log:
"Data connection failed to open: database=dbmcsdev;server=3illserver01;"
I'm assuming this is the reason why the DAAB version of the code is so slow compared to the regular ADO.Net.
Has anyone else experianced the same issue? Have a configured the DAAB
incorrectly..? I am using a regular predefined connection string for
the DAAB version of the application so not really sure how I could've
configured it wrong??
I should mention that my database and webserver reside on the same
machine so i dont think that there were any network issues that causes
these performace/database issues.
Anyways, if anyone out there could help me out or confirm my results I
would really appreciate it. As the last thing I want to do is convert
all my code back to ADO.Net.
|