Arrrgh! No improvement yet, but here's what I've tried. First, a
summary of the problem to answer a few of the questions here:
- Using the Multinet ftp client directly from the DCL prompt works
fine. Transfer time is about 10 seconds. Only the perl Net::FTP
client takes 23 minutes.
- The slowness is definitely in the transfer. I've been using the perl
debugger interactively (perl -de 0) and watching what happends at each
ftp call. Only the 'put' is slow, and I can watch the remote file
with a dir/size=all to see it growing slowly
----
Now, some more information:
- I've watched the client process IO counts, and this is interesting -
for the same file:
multinet ftp: 10 sec, buf io = 13, dir io = 3920
perl net:ftp: 23 min, buf io = 81984, dir io = 87067
- I added some print statements in ftp.pm to see what's going on, and
where it is doing a sysread of the local file, specifying a buffer
size of 10240, sysread is really reading in 512 byte chunks. So
reading my 40 Mb file in 512 byte chunks would take 81920 dio's, which
is pretty close to the io counts I list above.
- Based on the above overservation with sysread, I changed the ftp.pm
code from sysread to plain read, and increased the buffersize to
32768. My process io counts went down, but the elapsed time did not.
Drats!!!
- I used the 'multinet tcpdump' utility to watch what's going on. I
admit I'm a bit lost here, but something seems to indicate the
mismatched window size that Mr LBOHAN suggested:
multinet ftp: I see packets with "win 32768" consistently, both
directions
perl net:ftp: I see 5 or so "win 6144", followed by 1 "win 32768" in
the other direction
For the perl net:ftp, the exact number of 'win 6144' packets varies a
little, and the single larger 'win' size varies from 32768, 30160,
26976, etc. Anyway, if this is something with mismatched tcp window
sizes, I don't see how I can set this in the net::ftp client.
I'm trying to get my network folks here to help out. But any other
suggestions are still welcome, and thanks for the replies so far!