(I apologize in advance if that is too much crossposting)
I am a C++ developer working a large, multithreaded server product
using SQL Server 7.0 (SP2). Our server (a computer Telephony server)
makes heavy heavy use SQL Server from multiple threads using ODBC.
I'm having some terrible performance problems with accessing SQL
Server ODBC that only happen on a Dual CPU box. I'm wondering if
someone can help me figure out what's going on.
Our Telephony runs exclusively on Windows 2000/NT (server or
workstation), the same computer that SQL Server runs on. Until now
we have all developed and tested on single CPU boxes. Recently we
received a batch of Dual Dell Optiplex boxes for development and
testing. (Dual PIII 933 MHz, 256 MB RAM).
I was stunned to find that the server ran horrendously more slowly on
the Duals than it did on the singles. Initialization on a single CPU
box takes a matter of roughtly 10-20 seconds. On a dual box it takes
over a minute.
The problem initially occurs in acquiring ODBC connections. The first
couple of connections (SQLDriverConnect calls) go pretty quickly, but
eventually a thread will lock up inside of SQLDriverConnect and not
return for at least 10 seconds.
When SQLDriverConnect returns (with failure) the error message is
invariably one of the following errors:
[Microsoft] [ODBC SQL Server Driver][Shared Memory] General Network
Error. Check your network documentation
OR
[Microsoft] [ODBC SQL Server Driver] Timeout expire
And then on the existing connections we DO have (never more than 10 at
once) we start getting horrendous performance from queries. The same
queries that took milliseconds start taking 15 seconds or more (though
they all eventually succeed).
So far I've tried a number of remedies:
1. I've tried enabling/disabling ODBC connection pooling to no effect.
I've tried implementing my own connection pooling (caching HDBCs) to
very little effect (I get a little further before a connection
attempts start slowing down).
2. I've ensured that SQL Server allows an unlimited number of
connections.
3. I've tried setting the DSN network protocol to both named pipes and
TCP/IP -- no effect
4. I tried setting SQL Server to use only one of the CPUs -- no effect
5. I tried running SQL Server Profiler. The delay occurs between the
time we make the ODBC function call and the time that SQL Server
receives it. Once SQL Server gets the requrest it seems to process it
instantaneously. I don't know if this is accurate or just what
Proiler is reporting
SQL Server driver version: 2000.80.194.00
ODBC32.DLL version: 3.520.427687936
Thanks,
Joe O'