3

My experience is with LAMP stacks and not so much with .NET on Windows, but I've been given the task of trying to debug a slow site and I've run into a dead end after Googling everything I can think of.

This is the problem: Stack trace Every time a sql call is sent to the database it takes ~1 second to connect. I want to point out that it never errors, just takes a long time.

The box is running Win 2008 R2 with plenty of cpu and ram, IIS 7.5 and the db is a local mysql 5.1.66.

Inside the connectionStrings tag of the web.config is

<add          
    name="nameOfConnectionString"          
    connectionString="Driver={MySQL ODBC 5.1 Driver};
        Server=localhost;
        Database=db_name;
        Pooling=True;
        Option=3;
        User ID=user_name;
        PASSWORD=pw;"          
    providerName="System.Data.Odbc"     
/>

As a note, I've tried both with and without pooling to the same effect

And just to be sure, I've re installed the ODBC 5.1 driver from the mysql website today. I've also remoted onto the box and run some queries from MySQL Workbench, all the execution times are where they should be so I'm pretty sure its not an issue with the mysql install.

What should be my next step in trying to fix this? What can I look for?

UPDATE

The problem is fixed when localhost in the connectionString is replaced with the global ip address of the box. What would cause a name lookup of localhost to take a second?

2

0

You must log in to answer this question.

Browse other questions tagged .