Unix Technical Forum

sql server and vpn: performance/speed

This is a discussion on sql server and vpn: performance/speed within the SQL Server forums, part of the Microsoft SQL Server category; --> Hello NG, We have a performance problem in using a client server solution based on MS SQL-Server 2000 through ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 08:45 AM
JENS CONSER
 
Posts: n/a
Default sql server and vpn: performance/speed

Hello NG,

We have a performance problem in using a client
server solution based on MS SQL-Server 2000 through
a VPN tunnel (via broadband internet connection).

The SQL Server is running on a Windows 2003 Server
which is configured as VPN server as well.

We figured out that not the performance
of the VPN tunnel itself is the problem,
but the problem is the access to the MS SQL Server.

We tested it by executing sql statements on the Query Analyzer
on the VPN client (WIN XP built in) which is connected to the server
through the tunnel.

For example execution of the SELECT statement
"select TOP 1000 * from Items" on the
database trough the tunnel takes more than 30 times as much
than the same execution on the server itself or within the
server's local network.

But we can make FTP downloads from our server through
the tunnel with 600 KBit/s under same conditions
so the bandwidth of the tunnel should not be the problem.

Do you have any ideas how we can accelerate this
or does any one has made experiences
related to this topic?

Thanks for your help!

JENS

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 08:45 AM
Robert Klemme
 
Posts: n/a
Default Re: sql server and vpn: performance/speed

JENS CONSER wrote:
> Hello NG,
>
> We have a performance problem in using a client
> server solution based on MS SQL-Server 2000 through
> a VPN tunnel (via broadband internet connection).
>
> The SQL Server is running on a Windows 2003 Server
> which is configured as VPN server as well.
>
> We figured out that not the performance
> of the VPN tunnel itself is the problem,
> but the problem is the access to the MS SQL Server.
>
> We tested it by executing sql statements on the Query Analyzer
> on the VPN client (WIN XP built in) which is connected to the server
> through the tunnel.
>
> For example execution of the SELECT statement
> "select TOP 1000 * from Items" on the
> database trough the tunnel takes more than 30 times as much
> than the same execution on the server itself or within the
> server's local network.
>
> But we can make FTP downloads from our server through
> the tunnel with 600 KBit/s under same conditions
> so the bandwidth of the tunnel should not be the problem.
>
> Do you have any ideas how we can accelerate this
> or does any one has made experiences
> related to this topic?
>
> Thanks for your help!
>
> JENS


I don't think you can easily compare download speed (simple
unidirectional) with JDBC server communications (several calls back and
forth). Network latency is probably killing you. This latency might stem
from WAN and / or from encryption overhead.

You can try this

- increase fetch size for query results

- choose another select method (cursor vs. direct)

- tweak network settings to change the size of packets transferred

IMHO any DB protocol is sub optimal for wide area deployment. I'd rather
use a protocol tailored to your application's needs between client and
server, which also means you need another component on the server side
that is a client to the db and a server to your clients (middle tier).

Kind regards

robert

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 08:46 AM
Erland Sommarskog
 
Posts: n/a
Default Re: sql server and vpn: performance/speed

JENS CONSER (jens@e-sistrum.com) writes:
> We tested it by executing sql statements on the Query Analyzer
> on the VPN client (WIN XP built in) which is connected to the server
> through the tunnel.
>
> For example execution of the SELECT statement
> "select TOP 1000 * from Items" on the
> database trough the tunnel takes more than 30 times as much
> than the same execution on the server itself or within the
> server's local network.
>
> But we can make FTP downloads from our server through
> the tunnel with 600 KBit/s under same conditions
> so the bandwidth of the tunnel should not be the problem.


When you run QA directly on the SQL Server Box, or in your local
network, you have something like 100 MBit/s. 600 KBit/s is far
more than 30 times slower.

What speed is your VPN connection labeled at?


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-29-2008, 08:46 AM
hals_left
 
Posts: n/a
Default Re: sql server and vpn: performance/speed

I dont know much about VPN (yet) but I know that SELECT * causes an
extra trip to the database to fetch the fieldnames.

Are enterprise manager tools required a lot in the live environment?
if so you could look at the SQL Server Web Data Administrator, but
would need to deploy IIS/.NET.

http://www.microsoft.com/downloads/d...displaylang=en

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-29-2008, 08:46 AM
JENS CONSER
 
Posts: n/a
Default Re: sql server and vpn: performance/speed

we did the ftp-test only to proof that the tunnel speed is not
the reason and to see the current performance of the
tunnel. the vpn connection is shown on the network monitor
on the server with 28kbit/s and on the client with 100mbit/s
but both has nothing to do with the real performance.
especially the server speed is a real fake.
and also in a lan the speed is not real 100 mbit/s
despite it is shown for the network adapter.
so approx. 600 kbit/s should be the maximum performance
of the tunnel from our client (in egypt) to the server (in usa)

when i check the usage of the tunnel i see e.g. for this
select statement a data transfer of around 15 kbit/s.
so the tunnel bandwith should not be the reason.

when i executed the sql statement it takes 5 seconds
on the lan and more than 3 minutes through the tunnel.

i tend more to roberts opinion that the network latency is
the reason and the bidirectional communication,
although i can't image that a simple select causes
so much communication.

or does the server send each row seperately and waits
for the response ?

by the way ... i only used the query analyzer for testing,
as i wrote we have the real problem with our client-server-application.

i think i will try first to increase the packet size like robert said,
does anyone know how to do it in windows, before i waste
time to serach for it?
i have to do it on the client and on the server as well, right?

robert, is the increasing of the fetch size something global
(which i would need) or only a option in the query analyzer.

thanks for your help
JENS

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-29-2008, 08:47 AM
Erland Sommarskog
 
Posts: n/a
Default Re: sql server and vpn: performance/speed

JENS CONSER (jens@e-sistrum.com) writes:
> we did the ftp-test only to proof that the tunnel speed is not
> the reason and to see the current performance of the
> tunnel. the vpn connection is shown on the network monitor
> on the server with 28kbit/s and on the client with 100mbit/s
> but both has nothing to do with the real performance.
> especially the server speed is a real fake.
> and also in a lan the speed is not real 100 mbit/s
> despite it is shown for the network adapter.
> so approx. 600 kbit/s should be the maximum performance
> of the tunnel from our client (in egypt) to the server (in usa)


OK, but I assumed that there is some underlying physical connection,
and this one should have some speed as labeled by the service provider.

> when i executed the sql statement it takes 5 seconds
> on the lan and more than 3 minutes through the tunnel.


I don't know what sort of statement you executed, but does response
time change if you first say SET NOCOUNT ON?

Also, if you are in Query Analyzer, do you get different results for
grid mode and text mode?

> i tend more to roberts opinion that the network latency is
> the reason and the bidirectional communication,
> although i can't image that a simple select causes
> so much communication.


Looking at the application, it may matter what access methods you
use. Server-side cursors could have quite some penalty here.

> i think i will try first to increase the packet size like robert said,
> does anyone know how to do it in windows, before i waste
> time to serach for it?


I don't know about Windows, but you can set the packet size for
SQL Server communication when you connect. For instance, in
Query Analyzer you find this under Tools->Options->Connection.
It's also possible to set a different default packet size for
the server with sp_configure.



--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:16 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com