VPN is slow

VPN is slow

Postby codemaker » Wed Dec 11, 2013 2:54 pm

We have a VPN server (for now we use OpenVPN)
On this VPN server we have the DBF files located

Each client has an executable on his/her local machine.
The client connects to VPN server and from program we use something like this to open the DBF on sever:

c := "\\VPNserver\clients\1000\client1"
SET DEFAULT TO &c
SET PATH TO &c

The files are opened properly and all is functioning properly.
Except one thing - the speed!

I made some measurement. We need to open 18 DBF files on VPN server and it lasts about 2 and half minutes! I isolated only the part of code which uses the DBF at the program beginning and measured the start and end of the function job.

There is nothing I can do to speed up the process of opening. Each DBF is opened like this:
Code: Select all  Expand view

USE someDBF NEW SHARED
IF NETERR()
   MsgInfo("error message")
   QUIT
ENDIF
nSomeDBF := SELECT()
(nSomeDBF)->(ORDSETFOCUS("someTAG"))
 

Nothing special actually. And no space for optimization or speed up....

I am not sure if this is how VPN works regarding the DBF handling or something can be done on VPN server side, some setup.
In program, I don't see anything I can do.

Is it possible that VPN by itself is slow in the situation like mine?
It is mandatory for us to have DBF on VPN server, so we will not keep all on client side.

Any advice or help appreciated
Thanks
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: VPN is slow

Postby MarcoBoschi » Wed Dec 11, 2013 4:51 pm

It is normal!

1) Try to copy through this VPN a file
2) Try to open a file using the FOPEN function
3) Try to perform a aVpnDir := directory( "*.*" ) through this VPN

Speed of a Local area network (LAN 100 MBIT) is much greater than 256 KBIT of a VPN
User avatar
MarcoBoschi
 
Posts: 1016
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: VPN is slow

Postby codemaker » Wed Dec 11, 2013 5:29 pm

I hope this delay is big because I tested from Belgrade Serbia and the VPN server is in San Diego California USA.
We will try the program when running from some local computer in America, the speed should be much faster I hope.

Does the speed over VPN depends of the Upload speed on server and download speed on local machine?

It is disappointing speed over VPN, I hope it is not limited other than the internet upload speed from server and download speed on local machine....
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: VPN is slow

Postby MarcoBoschi » Thu Dec 12, 2013 4:35 pm

This is a little test:

k:\inno is a a folder in a server that I map through a vpn (normal speed for italy)

Code: Select all  Expand view

ANNOUNCE RDDSYS

FUNCTION MAIN

? seconds()
USE k:\inno\clienti  
// set index to K:\INNO\CLIENTI

? seconds()
GOTO 100
? ragcli
? seconds()
GO TOP  
tIni := SECONDS()
DO WHILE !EOF()
   ? ragcli , seconds() - tIni
   SKIP
ENDDO
? lastrec()            
RETURN NIL

INIT PROCEDURE RddInit
REQUEST DBFFPT
REQUEST DBFCDX
rddSetDefault( "DBFCDX" )
 


clienti.dbf 2611 records
dimension 673.928 bytes

If index is not used
I have 13 seconds at the end of execution

If index is used I have 49 seconds at the end of execution

Just for experience
marco
User avatar
MarcoBoschi
 
Posts: 1016
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: VPN is slow

Postby codemaker » Fri Dec 13, 2013 8:07 pm

Actally, VPN has not much to do about the speed.
If I use DBF on server and EXE on client machine, this means when I USE some DBF it is loaded completely, before I can use it. And this is the problem, not the VPN. The way my app works now is not a client/server app.

I will use VPN anyway, but the EXE will reside on the same server where DBFs are and will use TERMINAL access for each user. This way I will have a speed as my Web Application which uses the same logic (EXE and DBF on the same machine) - very fast.

Thanks for reading Marco
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: VPN is slow

Postby Otto » Fri Dec 13, 2013 9:42 pm

Boris,
how do you handle TERMINAL access for each user.
Thanks in advance and best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6022
Joined: Fri Oct 07, 2005 7:07 pm

Re: VPN is slow

Postby codemaker » Sat Dec 14, 2013 8:03 pm

Otto,
we are just planning to use terminals for our client.
Because the server will be in San Diego, I am not involved in this technical organizations, the only thing I know is this terminals plan, the other team is doing the actual job.

As I know, the Windows Servers allow certain number of terminals to use for free, more has to be paid. Have no idea about how many terminals we will use for now. But must be prepared for any necessary number, depending on number of potential clients.

The main idea is to have a separate terminal connection for each client (practically something like RDP but allows more than one client per connection)
This is the only way we can have a speed close to desktop speed, because in such case we need only about 64K of data to transfer to client for graphic display. This and the data required for VPN tunneling and data encryption is much less than loading the complete set of DBF files.
We were calculating that for example for 200 clients we need about 12-15Mbps upload speed, which is acceptable if we know the working speed will be satisfactory.

We already use one app I wrote which we access by Citrix server.
When I connect from Belgrade and the server is in San Diego, I am working 95% of desktop speed. And that server is not even close to 15Mbps of upload speed because this kind of connection requires very low upload. The app behaves like desktop, regarding the speed and overall look and feel.

I will let you know how this logic works and how we organized the whole process.
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: VPN is slow

Postby MarcoBoschi » Sat Dec 14, 2013 8:30 pm

Boris,
>>>is loaded completely, before I can use it.
this is not true, dbf is not loaded completely. It's just opened...

If you work only with dbf (no cdx or ntx) through a vpn maybe you can obtain accettable response time :-)
If you open cdx files too no!


>I will let you know how this logic works and how we organized the whole process.
good choice!
User avatar
MarcoBoschi
 
Posts: 1016
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: VPN is slow

Postby codemaker » Sun Dec 15, 2013 12:18 am

Maybe I am wrong Marco, but if my DBFs (780,000 kb) to load need 3.5 minutes - I suppose it loads completely? If not then I cannot imagine what the server is doing all that time. The testing server speed is around 4 Mbps of upload speed and my home internet is 30Mbps of download - more than enough.
As you know, I doubt anybody of us designed a serious app without using indexes, so yes - I am also using CDX.

In any case, the loading time depends on the internet speed, actually the upload speed of the server and then the client computer speed is also important. Al this considered, it will not work that way. Terminal is the next step to check.
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: VPN is slow

Postby Gale FORd » Sun Dec 15, 2013 1:46 am

If your server is limited to 4mb then your client is also limit to the same. There are many thinga involved when running on a network (opened in share mode) that makes the slow connection much more evident. Keep in mind that you are NOT running client server so most of the work has to be done on the client machines.
Here are a couple of issues.
1. Deleted records. If set deleted is on and you have deleted records then it has to skip over them.
2. # indexes in you cdx. When updating indexes there are many reads and updates that have to be done. To update just 1 btrieve index takes several locks, reads, and updates. It is kind of technical but it takes more communicating than you realize.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: VPN is slow

Postby MarcoBoschi » Sun Dec 15, 2013 9:38 am

Boris,
In this moment I am in my home.
I'm connected with my office server using a vpn ssl watchguard.
I'm mapped in volume server
I launch this command
N:\HSE\LA.DBF
in 20" the dbf is opened and cdx too with EMAGDBU.EXE (Enrico)

this is the dir of the three files opened by emagdbu

13/12/2013 21:31 316.928 LA.cdx
13/12/2013 21:31 2.216.252 LA.dbf
13/12/2013 17:12 339.520 LA.fpt

la.dbf contains 2015 records and in the index there are 19 INDEX TAG
User avatar
MarcoBoschi
 
Posts: 1016
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: VPN is slow

Postby MarcoBoschi » Sun Dec 15, 2013 9:49 am

another little test
I have created all index for this table
Locally (in the server usin mstsc) less than 1 second

Through vpn 60"
User avatar
MarcoBoschi
 
Posts: 1016
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: VPN is slow

Postby avista » Sun Dec 15, 2013 4:23 pm

Hi Boris,
I think you need to check if VPN use
direct or relayed tunneling
Direct tunneling ping is less than 60 ms and relayed more than 600 ms.
I use Logmein Hamachi and i am verry satisfied ...
However i use locations in one country but in different cityes and different providers.

(Primer imam tridesetak DBF in dosta indeksnih datoteka ali radi ok. Otvaranje traje svega nekoliko sekundi)
Best regards,
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: VPN is slow

Postby codemaker » Thu Dec 19, 2013 3:27 pm

avista wrote:Hi Boris,
I think you need to check if VPN use
direct or relayed tunneling
Direct tunneling ping is less than 60 ms and relayed more than 600 ms.
I use Logmein Hamachi and i am verry satisfied ...
However i use locations in one country but in different cityes and different providers.

(Primer imam tridesetak DBF in dosta indeksnih datoteka ali radi ok. Otvaranje traje svega nekoliko sekundi)
Best regards,


Hi Avista,

I remember long time ago, I was using Hamachi as some kind of server, it was for some games to be played together...
Is this the same thing as that Hamachi server?

How many simultaneous users can connect to such server? You are using VPN and Hamachi at the same time?

Can you advice me, where do you set up direct tunneling?

Thanks


(Krajem januara idem ponovo za Grčku, možda možemo da popijemo kafu negde usput? U kom gradu živiš?
Ako dolaziš u Beograd, javi se)
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: VPN is slow

Postby avista » Thu Dec 19, 2013 10:24 pm

Hi boris,

I am not sure about Hamachi in past but ... hamachi create VPN .. (so i dont use vpn and hamachi together)

Hamachi is intended as a zero-configuration virtual private network (VPN) application that is capable of establishing direct links between computers that are behind NAT firewalls without requiring reconfiguration (when the user's PC can be accessed directly without relays from the Internet/WAN side); in other words, it establishes a connection over the Internet that emulates the connection that would exist if the computers were connected over a local area network.


You configure nothing, and it create virtual IP for you and you can access to PCs like in LAN
It is free for use to create network (VPN) up to 5 members .. i have buyed it for 29$ (vpn up to 32 members)
No need to have a server, you just can share folders and use it like logical disks just like in LAN

Take a look please,
en.wikipedia.org/wiki/Hamachi_(software)
https://secure.logmein.com/products/ham ... nload.aspx
Download it and try it
We will be in contact,

Best regards,

(Ja zivim u Prilep pa bilo kada mozemo popiti kafu naravno i koju rakiju ako ides za grcku dobra mogucnost, Za Beograd sam ranije dosta cesto dolazio sada ne znam , cucemo se)
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 10 guests