# Upload blues.



## cgigeek (Dec 3, 2012)

Hello folks,
need a second pair of eyes, going crazy here,

I got 3 servers , on the same switch
I get uploading via ftp:
FreeBSD 8.3 AMD64 330.49 KB/s  default ftp server  
FreeBSD 8.3 AMD64 286.11 KB/s  default ftp server
Centos 6.3 x86_64  1.65 MB/s vsftpd server



I get very similar results on a second set on a diff switch.
All servers are identical mobo : S5000PSL

All switch ports and cat6 have been swapped around a few times, pretty much identical results and my collegue tells me he has tested other ftp servers on FreeBSD to no avail.

Why am I getting 1/5 the upload speed from Centos vs FreeBSD ?


----------



## Martillo1 (Dec 3, 2012)

1. disks speed
2. net card speed
3. ...

P.S.: please post HW specs, specially differences.


----------



## cgigeek (Dec 3, 2012)

Martillo1 said:
			
		

> 1. disks speed
> 2. net card speed
> 3. ...
> 
> P.S.: please post HW specs, specially differences.



there are none, all 3 servers are identical.


----------



## Martillo1 (Dec 3, 2012)

You make the three uploads at the same time?


----------



## cgigeek (Dec 3, 2012)

Martillo1 said:
			
		

> You make the three uploads at the same time?



No, one right after the other.
I made about 4 different upload batches, all pretty much the same results.


----------



## phoenix (Dec 3, 2012)

What are you uploading from (client machine specs/info) and what are you uploading to (server machine specs/info)?  It's not apparent from your post where the data is coming from or where it's going to.


----------



## mix_room (Dec 4, 2012)

cgigeek said:
			
		

> Why am I getting 1/5 the upload speed from Centos vs FreeBSD ?



Possibly ftp/vsftpd is the culprit. You could try using as similar a software stack as possible.


----------



## cgigeek (Dec 8, 2012)

mix_room said:
			
		

> Possibly ftp/vsftpd is the culprit. You could try using as similar a software stack as possible.



sorry dont follow, we did try ftp/proftpd and ftp/pure-ftp with almost identical results on FreeBSD not marginal gain or lose


----------



## cgigeek (Dec 8, 2012)

mix_room said:
			
		

> Possibly ftp/vsftpd is the culprit. You could try using as similar a software stack as possible.



we are currently using the default Feebsd ftpd server starting it with inetd


----------



## Anonymous (Dec 8, 2012)

cgigeek said:
			
		

> we are currently using the default Feebsd ftpd server starting it with inetd



Do use inetd only for daemons which cannot handle networking by themselves.

In other words add in /etc/rc.conf the following line:


```
ftpd_enable="YES"
```

Deactivate the ftp server in /etc/inetd.conf. If nothing else (default) is run by inetd, then deactivate inetd completely.

Get inetd out of the way and you may experience a performance boost.


PS: from ftpd(8)()



> -D      With this option set, ftpd will detach and become a daemon,
> accepting connections on the FTP port and forking children proâ€
> cesses to handle them.  This is lower overhead than starting ftpd
> from inetd(8) and is thus useful on busy servers to reduce load.


----------



## cgigeek (Dec 8, 2012)

rolfheinrich said:
			
		

> Do use inetd only for daemons which cannot handle networking by themselves.
> 
> In other words add in /etc/rc.conf the following line:
> 
> ...




I have tested it both as a daemon and with inetd,
just started it as a daemon, run a test pretty much identical results,
it wont ever go past 300K


----------



## cgigeek (Dec 8, 2012)

ouch

```
150 Opening BINARY mode data connection for '1.iso'.
  1% |                                                                                   |  5184 KB  303.28 KB/s    18:51 ETA^X^C
send aborted. Waiting for remote to finish abort.
226 Transfer complete.
5472256 bytes sent in 00:17 (301.22 KB/s)
ftp> passive
Passive mode: off; fallback to active mode: off.
ftp> put 1.iso
local: 1.iso remote: 1.iso
200 EPRT command successful.
150 Opening BINARY mode data connection for '1.iso'.
 13% |**********                                                                         | 47104 KB    1.58 MB/s    03:05 ETA
```
added cubic algo and changed the passive, got 1.58MB now,
changed too many things at once, will go back do it one at a time and report


----------



## cgigeek (Dec 8, 2012)

Is there a way to force passive mode off on standard FreeBSD ftp default server?


----------



## Anonymous (Dec 8, 2012)

Perhaps you could patch the source of ftpd to ignore PASV commands send by the clients.

However, I guess it would be more easy to not use PASV from the client side.

If active or passive mode transfers are of very different speeds then you might want to check firewall settings.

Anyway, I just checked the transfer rate via a 100 MBit/s Ethernet connection between the command line ftp client of a MacBook Pro and ftpd on FreeBSD 9.1-RC3 AMD64 running on low profile Dual Core Atom 1.6 GHz Board.


```
ftp> put test.dmg test.dmg
local: test.dmg remote: test.dmg
229 Entering Extended Passive Mode (|||55860|)
150 Opening BINARY mode data connection for 'test.dmg'.
100% |********************************************************|  1928 MiB   11.18 MiB/s    00:00 ETA
226 Transfer complete.
2022339942 bytes sent in 02:52 (11.18 MiB/s)
ftp>
```

Given that ftpd running on a low profile board is capable of handling data streams at the full 100 MBit/s rate hands down (20-25 % CPU occupation of one of the 4 HT cores), I assume that your problem is not at all related to ftpd.


----------



## cgigeek (Dec 9, 2012)

cgigeek said:
			
		

> Is there a way to force passive mode off on standard FreeBSD ftp default server?




```
sftp> put 1.iso
Uploading 1.iso to /home/master/1.iso
1.iso             4%   14MB 413.6KB/s   13:26 ETA <--- sftp

ftp> put 1.iso
local: 1.iso remote: 1.iso
229 Entering Extended Passive Mode (|||59532|)
150 Opening BINARY mode data connection for '1.iso'.
  2% |*                                                                                  |  8128 KB  323.93 KB/s    17:29 ETA <-------------- ftp passive(default)
ftp> passive
Passive mode: off; fallback to active mode: off.
ftp> put 1.iso
local: 1.iso remote: 1.iso
200 EPRT command successful.
150 Opening BINARY mode data connection for '1.iso'.
 15% |************                                                                       | 54400 KB    1.65 MB/s    02:53 ETA<-------------- ftp non passive
```

I am not really sure what it its, but seems I am on the right track finally,
your patch idea is excellent, thanks, will take a whack at it.


----------



## wblock@ (Dec 9, 2012)

cgigeek said:
			
		

> Is there a way to force passive mode off on standard FreeBSD ftp default server?



There's -E, see ftpd(8).  But please stop using FTP and switch to something more secure.  Like sftp(1), or possibly rsync(1).


----------



## cgigeek (Dec 9, 2012)

wblock@ said:
			
		

> There's -E, see ftpd(8).  But please stop using FTP and switch to something more secure.  Like sftp(1), or possibly rsync(1).



I agree with you, out of my hands tho.
Thank you for the -E tip, checking it now.


----------

