środa, 16 stycznia 2008

why cifs is so slow when mounting through the wan and vpn

Today I mounded some samba shares through the vpn (because of fact copying over 200GB of data, and quite easy method). I thought that using it will be easier to use in rsync. But I was totttaaalllyyy wrong :(
mount -t cifs // /store/test --verbose -o user=test -o directio -o rsize=200000 -o wsize=200000

rsync -avz -P /store/test/test.tar.bz2 /store/test_backup/

5799936 0% 87.15kB/s 18:03:01

rather poor transfer when we have a 5mbps link, don't you think so?

test another file from same server, but through http...
$ wget
=> `'
Connecting to|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 102,400,100 (98M) [text/plain]

2% [=> ] 2,123,712 567.60K/s ETA 02:56

The difference is almost 6 times. I google a lot to find the solution, because I thought that I have some error in my configuration or something. But I found only questions, with no answers. So I would like to sumarize what I found.

When CIFS was originally developed, users and applications were situated in close proximity and most network traffic stayed local to the user. In that environment, CIFS works quite well.  According to Nemertes Research, more than 80% of users now work outside the organization headquarters.

Three reasons of the poor cifs quality:

1. CIFS is a “chatty” protocol that often requires hundreds of round trips between file server and user in order to complete the original request to transport the file. These round trips are not noticeable in a LAN, but they introduce significant latency (delayed response time) across long distance WAN links.

2. To protect against data loss when a user is working on a file, many applications will do periodic automatic saves of work in progress. CIFS does its part by sending complete updates of the files back to the file server. While this preserves file integrity, it also exacerbates WAN congestion and performance delays because CIFS transports a
significant amount of redundant information.

3. WAN bandwidth is obviously far more limited and far more expensive than LAN bandwidth. Therefore, as more users and application traffic traverses WAN links

The net impact of the CIFS performance problem is unacceptably slow application response time experienced by remote users. Depending on the file size, WAN link, and other variables, the delays could be significant. In fact, it is not uncommon for a remote user to wait 15 minutes or more for a large file to be delivered to his or her desktop. When that “wait time” is experienced by hundreds of users spread out across dozens of locations, the CIFS performance problem becomes a severe business and user productivity
problem that must be fixed ASAP. But how?

For now - this question has no answer... but maybe in future?

0 komentarze: