cygwin performance problem

Corinna Vinschen vinschen at
Fri Apr 21 20:22:33 EST 2006

On Apr 20 16:17, Chris Rapier wrote:
> Corinna Vinschen wrote:
> > Since in both cases (scp/tar) the underlying Cygwin is identical, and
> > since in both cases the file is locally copied over a pipe between the
> > two processes (ssh->scp resp. ssh->tar), I'm currently really at a loss
> > why scp is so slow.  I tried various buffer sizes in the "sink" function
> > in scp.c, values between 4K and 512K, but this had no influence at all.
> > I have to debug this a lot more, apparently, but...  if anybody has a
> > clue why copying over scp could be so much slower than copying over tar,
> > I'd really appreciate it.
> Do you have any tools under cygwin that could tel you what syscalls are 
> being made during the transfer? If we can find out where its spending so 
> much of its time that might help.

Yes, and I can see that the most time is spent in select as well as
reading and writing on the pipe.  I still have to find out why this
is, though.

> Also, regarding the buffer size: I'm not quite sure of which buffer you 
> mean, however the value in
>    if ((bp = allocbuf(&buffer, ofd, 4096)) == NULL) {

Exactly this value.  I hacked the code so that the buffer size is
a configurable value.  But changing this didn't improve the performance in
a noticable manner.

>  Since I'm running 1000 
> iterations its going to take a while (so 18,000 xfers). But maybe it 
> will shed some light on this.


Corinna Vinschen
Cygwin Project Co-Leader
Red Hat

More information about the openssh-unix-dev mailing list