Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: forsik on May 15, 2012, 03:15:23 PM

Title: Transfer rate on the ftp server
Post by: forsik on May 15, 2012, 03:15:23 PM
Hello all

I would use a netbook with external usb drive as a NAS, but the data rate is poor.

I have a wifi router, the speed of data transmission between computers within network 802.11g  standard is about 6 megabytes per second. Both computers are on the same wifi network. One is windows (using total commander and a standard explorer to copy the data), on the other TC server.

Usb drive with the file system ntfs, on a computer running windows allows you to record data at speeds far greater than 6 megabytes per second.

Used bftpd demon with a standard configuration. To support the use of systems nfts nfts-3g. Also in the fuse and installed util-linux.

Is it possible to somehow speed up the data on the usb drive, or I want a lot of weak netbook?

copied to the disk fast enough

Code: [Select]
# du -sh file.tgz
4.1M    file.tgz

# time cp file.tgz /ftp
real    0m 0.96s
user    0m 0.00s
sys     0m 0.17s

What else can I check?
Title: Re: Transfer rate on the ftp server
Post by: curaga on May 15, 2012, 04:06:00 PM
You didn't mention what rate are you getting?

ntfs-3g (any FUSE fs) by itself is not fast. If the drive is only accessed over network, maybe consider ext4?

You could also watch top while doing a transfer, to see if anything is using a lot of cpu.
Title: Re: Transfer rate on the ftp server
Post by: forsik on May 15, 2012, 04:23:40 PM
I create a backup copy of data in windows, using cobian backup, it creates several zip files, then copies them to the ftp, located on my netbook. Copy speed extremely slow, about 50-100 kilobits per second. The maximum speed of 500 kilobytes per second.

Htop says that ~ 60% of the load generates ntfs-3g driver

If using ext3 (ext4) creates a large increase in speed, then we can consider this option. However, I would like to first check whether this is.

upd: It looks like part of the problem is wifi connection. I do not know why, but when I used a wired connection, transmission speed has increased about 3 times, but it still is not more than 1.3 megabytes per second.
Title: Re: Transfer rate on the ftp server
Post by: curaga on May 15, 2012, 05:28:50 PM
60% is a lot. But first test the upload speed with /ftp in RAM. If that goes fast, the bottleneck is on the disk side, if not, server and/or network.
Title: Re: Transfer rate on the ftp server
Post by: forsik on May 15, 2012, 06:03:16 PM
Code: [Select]
# blkid | grep sdb
/dev/sdb1: UUID="6054DA9E54DA766E" TYPE="ntfs"

# df -h | grep sdb
/dev/sdb1               232.9G    154.5G     78.4G  66% /ftp

$cd /ftp

$ time wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.3.6.tar.bz2
Connecting to www.kernel.org (149.20.4.69:80)
linux-3.3.6.tar.bz2  100% |*******************************| 77108k  0:00:00 ETA
real    1m 36.33s
user    0m 1.06s
sys     0m 12.05s

$ du -sh linux-3.3.6.tar.bz2
75.3M   linux-3.3.6.tar.bz2

75.3 / 96 = 0.78 mb/s ....
Downloading to the internal flash memory with ext3 is much slower.

another test

Code: [Select]
# time wget http://support.satgate.net/dl_test/dl/100MB.bin
Connecting to support.satgate.net (77.94.34.153:80)
100MB.bin            100% |*******************************|   100M  0:00:00 ETA
real    1m 19.67s
user    0m 0.73s
sys     0m 9.22s

# du -sh 100MB.bin
100.0M  100MB.bin

~ 1.27 mb/s
Title: Re: Transfer rate on the ftp server
Post by: curaga on May 16, 2012, 05:11:58 AM
I mean in RAM.
Quote
sudo mount tmpfs /ftp -t tmpfs
#restart bftpd
#do the test transfer
sudo umount /ftp
Title: Re: Transfer rate on the ftp server
Post by: forsik on May 16, 2012, 05:47:14 AM
I ran some tests, the speed of Internet connections corresponds to the claimed my ISP (15 megabit is about 1.8 mb/s). But the speed within the same wifi network should not be limited to this value. I have a data transfer speed from computer to the server is an average of 900 kbit/s, when using RAM as /ftp. In this case, the most difficult process bftpd, and it consumes not more than ~ 20% CPU time. How else can I find out where in the limit?
Title: Re: Transfer rate on the ftp server
Post by: curaga on May 16, 2012, 06:11:34 AM
Okay, that looks like both ntfs and your network are bottlenecks. I'd recommend some network bandwidth testers, but I don't know any that work on Windows too (they usually need two machines).
Title: Re: Transfer rate on the ftp server
Post by: Rich on May 16, 2012, 08:04:54 AM
Hi forsik
You could boot the Windows machine which a Tinycore CD and try some ftp transfers with it.
That will tell you if Windows is limiting your transfer speed.
Title: Re: Transfer rate on the ftp server
Post by: forsik on May 16, 2012, 08:36:31 AM
Yes,no problem,I'll try later to boot from the stick. What program do you advise me to check the speed in tc?
Title: Re: Transfer rate on the ftp server
Post by: curaga on May 16, 2012, 08:39:58 AM
#machine 1
nc -l -p 7777 | dd > /dev/null

#machine 2, replace 1.1.1.1 with machine 1's IP
nc 1.1.1.1 7777 </dev/zero


ctrl-c after a while.
Title: Re: Transfer rate on the ftp server
Post by: Rich on May 16, 2012, 09:43:56 AM
Quote
#machine 2, replace 1.1.1.1 with machine 1's IP
nc 1.1.1.1 7777 </dev/zero
If you do:
time nc -vv 1.1.1.1 7777 </dev/zero
You'll get elapsed time and bytes sent, no need to pipe through dd on machine 1.
Title: Re: Transfer rate on the ftp server
Post by: curaga on May 16, 2012, 10:35:29 AM
Right, thanks Rich. dd does give it already in MB/s form though ;)
Title: Re: Transfer rate on the ftp server
Post by: Rich on May 16, 2012, 10:55:00 AM
Hi curaga
Thank you, I was not aware that dd gave that information. Should have suspected you'd done
something clever.
Title: Re: Transfer rate on the ftp server
Post by: forsik on May 16, 2012, 12:09:52 PM
Code: [Select]
# nc -l -p 7777 | dd > /dev/null
22783+8988 records in
22783+8988 records out

# time nc <ip> 7777 </dev/zero
^Cpunt!
Command terminated by signal 2
real     0m 28.14s
user    0m 0.00s
sys     0m 0.00s

Code: [Select]
# nc -l -p 7777 | dd > /dev/null
29881+11780 records in
29881+11780 records out

# time nc -vv <ip> 7777 </dev/zero
<ip> (<ip>:7777) open
^Csend 20176896, rcvd 0
punt!
Command terminated by signal 2
real     0m 36.73s
user    0m 0.00s
sys     0m 0.73s

Frankly, I do not understand what units of measurement that were measured, and what the resulting outcomes. (If I ever made)
Title: Re: Transfer rate on the ftp server
Post by: Rich on May 16, 2012, 01:11:00 PM
Hi forsik
20176896 / 36.73s is about 550 thousand bytes per second.
Title: Re: Transfer rate on the ftp server
Post by: curaga on May 16, 2012, 01:19:31 PM
Hm, forgot that our bb dd didn't do that, the config option's disabled.

@forsik:

The transfer rates were 564 kb/s and 536kb/s. This is a pure network test, so it looks like your wireless is the biggest bottleneck. Once you fix that, ntfs will be the next one ;)

Maybe post the output from iwconfig?
Title: Re: Transfer rate on the ftp server
Post by: forsik on May 16, 2012, 02:25:35 PM
Rich, curaga thank you for the clarification

> Maybe post the output from iwconfig?

I have to use a wired connection to the router (eth0). I think it will increase the number of connection speed. The computer client (on windows) connects to the server base using wifi.

My knowledge is only enough so that using "# ifconfig wlan0 down" to turn off the wifi adapter.

Of course, I can turn on wifi, Connect the access point and cause the output

Code: [Select]
# iwconfig
wlan0     IEEE 802.11bg  ESSID:<essid>
          Mode:Managed  Frequency:2.457 GHz  Access Point: <ap>
          Bit Rate=54 Mb/s   Tx-Power=20 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=70/70  Signal level=-29 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:2   Missed beacon:0

add: I have a SD card kingston 16gb class 10, and I can format the ext4 to verify. Does this make sense?
Title: Re: Transfer rate on the ftp server
Post by: curaga on May 16, 2012, 03:14:55 PM
Not really, SD cards are always slow. Use RAM when testing network speed.
Title: Re: Transfer rate on the ftp server
Post by: forsik on May 17, 2012, 08:22:31 AM
I experimented with the settings a router, put polee weak encryption, set the 802.11 Mode g (supported only b / g / auto), has replaced Channel No. Now, the test produces 2.4 mb/s. I do not know is it possible to somehow speed up the network ... If all else fails then it seems it's time to change the router.

If I copy from windows using total commander, then no difference in speed between copying at nfts usb disk and copying into RAM. Speed ​​is 1.5 mb/s

Even a small increase in speed (about 0.1 mb / s) can provide include gzip compression loading. But this option is preloaded 100% CPU as soon as the transfer begins.
Title: Re: Transfer rate on the ftp server
Post by: curaga on May 17, 2012, 11:06:29 AM
It may be wireless interference, in which case changing the router wouldn't help.
Title: Re: Transfer rate on the ftp server
Post by: forsik on May 17, 2012, 11:21:50 AM
Too little distance between the client and the router. Most likely the problem is a bad router. As far as I can remember when I was able to connect to the Internet at a speed of 50 mbit/s had a problem with a stable work and breaks, especially on "big" speed. Now there is much more sophisticated models :)

It looks like replacing the router is not much help to solve the problem. The next problem would be a netbook ... It will be easier to buy a model of the router, which already has an option to connect usb drive as an ftp server. In this case it is necessary to clarify the need for external power usb drive.
Title: Re: Transfer rate on the ftp server
Post by: Rich on May 17, 2012, 11:33:34 AM
Hi forsik
If you feel like trying one more test, it might be useful if we could see where the processor is spending
its time. On each machine run top, start another speed test using the nc command, and wait a couple
of seconds for the systems to settle. On each machine, move the mouse pointer to the lower right
corner of the window running top and right click, the text will be highlight meaning it has been copied
to the paste buffer. You can paste the contents into Editor by clicking the middle mouse button if you
need to save it as a file. Paste the results from the two machines in your next post.
Title: Re: Transfer rate on the ftp server
Post by: Rich on May 17, 2012, 11:43:02 AM
Hi curaga
I like the idea of using dd to measure transfer speed. One thing I noticed though, dd starts timing from
the moment you hit enter on the receiving machine, not the transmitting one. Maybe something like
this on the transmitting machine is more appropriate?
Code: [Select]
dd if=/dev/zero | nc -vvv 192.168.1.46 5555
Title: Re: Transfer rate on the ftp server
Post by: coreplayer2 on May 17, 2012, 02:46:43 PM
If you have to use wireless, change the channel to one which is not close to any others in use by your neighbors.. 

A modern 2TB drive would be like night and day difference compared to an SD/ USB thumbdrive (which are both slower than Molasses!)
Title: Re: Transfer rate on the ftp server
Post by: forsik on May 17, 2012, 04:26:13 PM
To use a modern drive, I need a separate computer that will work around the clock, or buy a special NAS. At the same time I have to throw out a netbook, which I wanted to find a use. If not for this netbook, I'd hardly ever met slitaz or tinycore :)

In any case, now I can not get a wireless speed of more than 2,5 mb/s. At this rate I can not wait for even one backed up copy of data relevant to me. Tomorrow I will try again to run nc and htop, I will write about the results.
Title: Re: Transfer rate on the ftp server
Post by: coreplayer2 on May 17, 2012, 05:39:50 PM
You'll need to get a dual band wireless adapter to improve the speeds.  I have a 60Mb/s connection and a router prioritized for my specific needs, yet across wifi a few Mb/s is all i'll likely ever get when transferring files across the lan..   

Much of the bandwidth is determined by the type and size of the data you're trying to move.
Title: Re: Transfer rate on the ftp server
Post by: forsik on May 18, 2012, 09:57:18 AM
I bought a new router with support for usb devices (usb drive, 3g modem, print server). Standard N does not have to limit the speed, but still our tests do not show such good results as we would like.

Copy speed of RAM via wifi on average about 5 mb/s.
At the same cpu load on the server: ~20%=nc, ~10%=dd.
If use connect a ntfs drive to the router and use it as ftp, at an average rate of ~ 3 mb / s.

On a router installed linux, reportedly busybox and etc in the settings. Rather ntfs partition reduces the speed.

I think that the nc test shows incorrect results, or the resources being spent on something else.

upd: Of course, I try one more thing. Try to transfer data from laptop to desktop computer. Only carry out the installation of TC on it, I will not, and how to install bftpd when working with flash, I do not know.
Title: Re: Transfer rate on the ftp server
Post by: Rich on May 18, 2012, 10:11:19 AM
Hi forsik
Quote
Copy speed of RAM via wifi on average about 5 mb/s.
If that is 5Mbytes/Sec and the router has a speed of 54Mbits/Sec, then you are pretty close to the
limit of the router and are doing well. As a general rule of thumb, when converting between Mbytes/Sec
and Mbits/Sec I multiply/divide by 10 to allow for protocol/packet overhead and errors, and to keep
the numbers conservative.
Title: Re: Transfer rate on the ftp server
Post by: forsik on May 18, 2012, 10:23:53 AM
But a new router speed is higher, the netbook (the server) is connected by wire with a maximum speed of 100 mbit/s, the laptop (client) is working to support IEEE 802.11n ... is faster than 100 mbit/s. 100 mbit/s ~ 10..12 mb/s

Maybe the network card netbook simply can not miss the speed of more than 5 mb/s?
On the wireless connection, I think, and say no, it certainly is lower than
Title: Re: Transfer rate on the ftp server
Post by: Rich on May 18, 2012, 10:38:41 AM
Hi forsik
Maybe it is the network card limiting you now. You previously ran  iwconfig  and it reported a Bit Rate
of 54Mbits/sec, what does it say now?
Title: Re: Transfer rate on the ftp server
Post by: forsik on May 18, 2012, 10:44:00 AM
iwconfig only works with wireless connections, I use eth0.
(iwconfig says 54 mb/s and b, g standard for the wifi card)

I spent a few tests the speed of internet connection. Most of them have given the result of 2 .. 6 mb / s, one of the tests gives a speed of 11 mb/s. If 10 mb/s download speed actually achievable from the Internet, what's the problem get so much speed in the network ... I do not understand...
Title: Re: Transfer rate on the ftp server
Post by: forsik on May 19, 2012, 07:28:17 PM
I saved the data from the usb drive and formatted it in ext3. On a router transfer speed of a file has not changed. But there is the possibility to upload up to 5 files at a time, eventually I get the latch speed, a total of up to 15 Mb/s. (No, all the same for less ... more than 6-10 mb/s speed is rarely)

We'll see how it will affect the connection netbook usb drive. In this case, restrictions on the number of simultaneous connections is not present. Let's see what the processor can handle.