LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Slackware server ( network problem... ) (https://www.linuxquestions.org/questions/linux-networking-3/slackware-server-network-problem-656172/)

alpha_hack 07-16-2008 12:31 PM

Slackware server ( network problem... )
 
Hey,

Me and my brother have a home server. It's an old pc with Slackware 11 on it.
The internet provider gives us 2.5MB speed. We have 1 cable that goes into a switch ( 10/100M ) and after that another cable that goes into the server. The problem is that if I start downloading something my speed can't cross 1.5MB what ever I do. It's not from the switch nor the server nor the cables or the OS. If I try to upload or download something from the server I do it with about 3-6MB/sec but when I try the net - 1.5MB....

I've thought "Hey my net ISP is limiting something ..." so I stopped the server and set up my desktop with the settings for my IPS and I was downloading/uploading with 2.5MB... This means that something is not configured right on the server....

ifconfig:
Code:



eth0      Link encap:Ethernet  HWaddr **:**:**:**:**:** 
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20e:2eff:fe95:c34a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:153051191 errors:57 dropped:130 overruns:26 frame:0
          TX packets:147246539 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3492006881 (3330.2 Mb)  TX bytes:787993544 (751.4 Mb)
          Interrupt:11 Base address:0x6500

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4417 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4417 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:579540 (565.9 Kb)  TX bytes:579540 (565.9 Kb)

ppp0      Link encap:Point-to-Point Protocol 
          inet addr:***.***.***.***  P-t-P:***.***.***.***  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:65483421 errors:0 dropped:0 overruns:0 frame:0
          TX packets:84541643 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:2770589270 (2642.2 Mb)  TX bytes:4043721561 (3856.3 Mb)

So I get my net from ppp0 and eth0 is the local network.


Is there some default setting that limits the connection ? Another thing - how could you limit the connection ( If I know how to limit it I may discover how to unlimit it :) )

If somebody has a question feel free to ask me ;)




Thanks in advance,
tftd

pruneau 07-16-2008 02:29 PM

I'm no sure I understand your network setup when everything is plugged in and up. Do you have a router/modem ?

trickykid 07-16-2008 03:07 PM

Also just cause you have 2.5MB bandwidth potential max doesn't mean you'll always get such speeds. Perhaps the server your downloading from only has a 1.5MB upload max. I can setup a machine on a GB switch with GB network card but am I always going to get GB speed? I doubt it. More details about your setup might be a little more useful to see if you can't get a little more out of it.

David1357 07-16-2008 03:45 PM

Quote:

Originally Posted by alpha_hack (Post 3216630)
Me and my brother have a home server. It's an old pc(emphasis added) with Slackware 11 on it.

Have you considered the possibility that the file system interface on the "old pc" might be the bottleneck?

You can run tests to see how fast you can write to your file system on your "old pc" and your "desktop". If it takes a lot longer to create a 100 MB file on your "old pc" than your "desktop" then you know the file system interface is the problem. On your Slackware server, you can use
Code:

time dd if=/dev/zero of=/tmp/blah.dat bs=1M count=1024
to write a 1 GB file to see how long it takes to create a very large file. On an old machine here, I got the following result
Code:

[man@machine1:~]:time dd if=/dev/zero of=/tmp/blah.dat bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 35.363 seconds, 30.4 MB/s

real    0m35.436s
user    0m0.020s
sys    0m8.109s

On a more modern machine, I got
Code:

[man@machine2:~]:time dd if=/dev/zero of=/tmp/blah.dat bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 18.984 seconds, 56.6 MB/s

real    0m20.174s
user    0m0.024s
sys    0m12.089s

If your "old pc" is very slow, it may not be able to handle the simultaneous load of hundreds of network interrupts per second at the same time it is performing hundreds of disk writes per second.

If the file system turns out to be fast enough to handle the load, you can use Iperf to measure throughput across your network. You should be able to transfer data as fast as your switch or router allows (100 Mbps or 10 Mbps depending on the actual device). If you see something less than that, you can look at the values in
Code:

/proc/sys/net/core
/proc/sys/net/ipv4

There are a lot of "knobs" to turn in those directories, but if you are patient, you can find the one that will improve your throughput.

alpha_hack 07-16-2008 05:22 PM

Quote:

Originally Posted by David1357 (Post 3216843)
Have you considered the possibility that the file system interface on the "old pc" might be the bottleneck?

You can run tests to see how fast you can write to your file system on your "old pc" and your "desktop". If it takes a lot longer to create a 100 MB file on your "old pc" than your "desktop" then you know the file system interface is the problem. On your Slackware server, you can use
Code:

time dd if=/dev/zero of=/tmp/blah.dat bs=1M count=1024
to write a 1 GB file to see how long it takes to create a very large file. On an old machine here, I got the following result
Code:

[man@machine1:~]:time dd if=/dev/zero of=/tmp/blah.dat bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 35.363 seconds, 30.4 MB/s

real    0m35.436s
user    0m0.020s
sys    0m8.109s

On a more modern machine, I got
Code:

[man@machine2:~]:time dd if=/dev/zero of=/tmp/blah.dat bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 18.984 seconds, 56.6 MB/s

real    0m20.174s
user    0m0.024s
sys    0m12.089s

If your "old pc" is very slow, it may not be able to handle the simultaneous load of hundreds of network interrupts per second at the same time it is performing hundreds of disk writes per second.

If the file system turns out to be fast enough to handle the load, you can use Iperf to measure throughput across your network. You should be able to transfer data as fast as your switch or router allows (100 Mbps or 10 Mbps depending on the actual device). If you see something less than that, you can look at the values in
Code:

/proc/sys/net/core
/proc/sys/net/ipv4

There are a lot of "knobs" to turn in those directories, but if you are patient, you can find the one that will improve your throughput.

Thank you very much for this detailed information !
I learned many things. I know that my speed wont be exactly 2.5MB on every site but as I said - If i plug the cable directly to my desktop machine and start downloading from a Bulgarian site I download with about 2.0-2.5MB. If I make my connection thought the server I can't go up 1.5 (which is 50% less)...

This is what "time dd.." returned:
Code:

root@*:~# time dd if=/dev/zero of=/tmp/blah.dat bs=1M count=1024
1024+0 records in
1024+0 records out

real    4m7.108s
user    0m0.010s
sys    0m53.840s
root@*:~#

I don't know if this is bad or good...

David1357 07-17-2008 05:15 PM

Quote:

Originally Posted by alpha_hack (Post 3216948)
This is what "time dd.." returned:
Code:

root@*:~# time dd if=/dev/zero of=/tmp/blah.dat bs=1M count=1024
1024+0 records in
1024+0 records out

real    4m7.108s
user    0m0.010s
sys    0m53.840s
root@*:~#

I don't know if this is bad or good...

Code:

real    4m7.108s
Four minutes to create a 1GB file is 4.1 MB/s. That is very slow. You can assume that is the total bandwidth of your CPU (since the bandwidth of even the slowest ATA interface will be much faster than that).

Assuming a 50/50 CPU bandwidth split with the network interface, you can calculate that your maximum possible file transfer speed is 2.05 MB/s which is close to what you are seeing.

You need a faster CPU (and possibly faster RAM) to see faster transfer speeds.

alpha_hack 07-17-2008 08:42 PM

You are incredible :)
Thank you VERY much for this valuable information !
My server is 200Mhz with 64ram in the moment... it's a really old machine. I though that was the problem in first place but when I tested with local upload/download I got confused.

Once again - Thank you ! :)


All times are GMT -5. The time now is 01:10 PM.