List:General Discussion« Previous MessageNext Message »
From:Larry Lowry Date:January 21 2005 8:49pm
Subject:Connection performance, suggestions?
View as plain text  
Before I ask this question I must state I love mySql and want to use it more.
But I work in a shop were we mostly use SQL Server 2000.  In trying to use
mySql (4.12 and 4.19) we are seeing some performance issues.  I hope 
someone can help me with this.  I am in a Windows 2003 server environment and
running mostly asp.net applications.

I have narrowed the problem down to the speed at which the database connections
open and close.   The following code opens a mySql database 100 times.
This takes 21 to 23 seconds.  I know I should only open the connection once
but this represents the asp environment where we are using a cluster of web
servers.  MySQL is running on an Athlon 64 3500+ with 2 gigs of memory. It is the
only process on the server.

The SQL server code below does the same thing except to Sql Server 2000.  This
only takes .1 to .4 seconds.   Sql Server is running on a PIII at 1.2ghz with 
1gb memory.  It's a crappy old box for testing.

I am using the stock Framework 1.1 SqlClient and MySql.Data.MySqlClient 
version  1.0.3.31712.  All test boxes are on the same network switch.

Can anyone help explain this difference?  Is it the database engines or the 
data connectors? Any help would be appreciated.

Thanks

Larry Lowry


'MySql Code
  Dim sDBCS As String = "Server=DB;UserId=userid;Password=pass;Database=images"
  Dim i As Long
  Dim ti As Long = Microsoft.VisualBasic.Timer()

  Dim db As MySqlConnection
  db = New MySqlConnection(sDBCS)
  For i = 1 To 100
    db.Open()
    db.Close()
  Next
  db.Dispose()
  tbEnd.Text = Microsoft.VisualBasic.Timer() - ti


  'SQL Server
  Dim sDBCS As String = "Data Source=db;User Id=userid;Password=pass;Initial
Catalog=images"
  Dim i As Long
  Dim ti As Long = Microsoft.VisualBasic.Timer()

  Dim db As SqlConnection
  db = New SqlConnection(sDBCS)
  For i = 1 To 100
    db.Open()
    db.Close()
  Next
  db.Dispose()
  tbEnd.Text = Microsoft.VisualBasic.Timer() - ti


Thread
Connection performance, suggestions?Larry Lowry21 Jan
Re: Connection performance, suggestions?Peter J Milanese21 Jan
  • Re: Connection performance, suggestions?Larry Lowry21 Jan
Re: Connection performance, suggestions?Larry Lowry23 Jan
  • RE: Connection performance, suggestions?Donny Simonton23 Jan
Re: Connection performance, suggestions?Larry Lowry24 Jan
  • Re: Connection performance, suggestions?Dan Nelson24 Jan