inetutils 1.5 / ftpd problem: 426 Data connection: No buffer space available.

Charles Wilson cygwin@cwilson.fastmail.fm
Wed Apr 30 08:01:00 GMT 2008


antony baxter wrote:

>> Unfortunately, with XP SP2, Cygwin 1.5 as the server machine, I get
>> pretty much the same symptoms with each of the above ftpds serving up
>> a 350mb file:
>>
>> 1. In all cases, the ftpd process' memory usage increases to ~350mb,
>> 2. As the buffer value decreases, the process' cpu usage increases
>> (ftpd-1k.exe used about 75% of the cpu vs. about 10% for ftpd-8k.exe),
>> 3. Performance jumped around (ftpd-1k transferred the file in
>> 90seconds, ftpd-4k in 166 seconds, ftp-8k in 114 seconds on a wired
>> network)
> 
> Quick addendum: I copied over in.ftpd.exe from another Cygwin
> installation running inetutils 1.3.2 and symlinked it to ftpd on my
> server; using that to serve the same file, memory usage sticks at
> 3500kb, cpu usage never rises about 5%, and the file was delivered in
> 194 seconds.

Well, one of the differences between ftpd-1.3.2 and ftpd-1.5 is that the 
newer version uses mmap on the (local) file.  ftpd.c is the /only/ 
source file in inetutils that uses mmap.

So, I recompiled with HAVE_MMAP turned off (but still using 4k chunks). 
Give this a try:

http://cygwin.cwilson.fastmail.fm/ITP/ftpd-no-mmap-4k.exe.bz2

I get behavior here which is very similar to what I reported for the 
4k-WITH-mmap version:
   (1) sane memory profile
   (2) topology one, 9-10 Mbps 2-3% cpu
   (3) topology two, 14-15 Mbps, 4-6% cpu [*]

I'm not sure what benefit mmap has in this case -- unless you can 
exploit some zero-copy kernel code for transferring data from disk to 
ethernet device. But I don't think Windows has anything like that. I 
certainly don't *see* any benefit, in my limited testing on this set of 
hardware.

If this *does* fix the problem, it may point to an issue with 
cygwin-1.5's mmap implementation, or with XP's handling of the 
underlying NtCreateSection()...mmap is not supposed to be CPU-intensive.

--
Chuck

[*] However, with the mmap'ed, 4k buffer version, I also saw only 4-6% 
CPU utilization on Vista, cygwin-1.7.  So, YMMV.



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list