TCP/IP performance - slow

Discussion in 'Mac OS X Lion (10.7)' started by funkahdafi, Nov 10, 2011.

  1. funkahdafi macrumors 6502

    Joined:
    Mar 16, 2009
    Location:
    Planet Earth, Old World
    #1
    Hi,

    here is something odd. Ever since I upgraded to Lion, my internet speed (100 mbit pipe) seems to be much slower than before.

    There is a speed test tool offered by my ISP (on their servers, so basically the same network) on which I hardly reach 50 mbit.

    Now here is the odd part: If I reboot into Windows 7 (bootcamp), that very same speed test gives me the full 100 mbit from within Windows. So it must be something with Lion.

    The slow down on Lion only seems to affect single connections (e.g. one HTTP download). When using multiple connections at the same time (like bittorrent), it goes all the way up to the 100 mbits.

    Any ideas?

    Thanks
    Sascha
     
  2. funkahdafi thread starter macrumors 6502

    Joined:
    Mar 16, 2009
    Location:
    Planet Earth, Old World
    #2
  3. dyn macrumors 68030

    Joined:
    Aug 8, 2009
    Location:
    .nl
    #3
    That article says the problem has been there from Tiger aka 10.4 making it an overall OS X problem, not a Lion one. That also makes it less likely that you fixed it, it might have just been a fluke on the other end of the connection. It is common to limit the bandwidth, they might have limited it to 50 instead of 100 Mbit. It also highly depends on the speed test you are doing. Most speed tests are highly unreliable. On speedtest.net it really depends on what server you get. The nearest server gives my the most crappy speeds whilst a server a bit further away gives me a much better result (and I believe a more realistic one too).
     
  4. phyrexia macrumors 6502a

    Joined:
    Sep 3, 2010
    #4
    934Mbit/s on my gigabit ethernet home network after doing this!
     
  5. funkahdafi thread starter macrumors 6502

    Joined:
    Mar 16, 2009
    Location:
    Planet Earth, Old World
    #5
    Dude, have you even read what I wrote? Clearly not.

    1.) I fixed it. With the help of that article.

    2.) I haven't used any limiting speed tests, I have used the one provided by my ISP. They use it as a support utility and it is clearly not limited. In fact, if you call them to complain about speed issues, first thing they do is point you to that very speed test. They wouldn't do that if they had limited it, would they? Think.

    3.) Most importantly: When I tried the same speed test utility from my ISP using Windows 7 instead of Mac OS X (same day time, two minutes after the test with Mac OS) I got the full 100 mbit. Two minutes later I try again with Mac OS, I get 50 mbit. This had a clear pattern and was reproducible.

    4.) I tweaked the TCP parameters as described in that article and the speed test *immediately* went up to 100 mbit. A clear indicator that whatever was set before, was less than optimal.

    Also, I never said this would be a isolated Lion problem. All I said was that this happened after I upgraded from 10.6 to 10.7. I did not have this problem with 10.6.

    ----------

    I never had problems on my local network. I am using iSCSI storage all the time with full 1 gbit speed with no problems. The problem I described only affected connections that traversed a router, e.g. my internet connection.
     
  6. johnhurley macrumors 6502a

    johnhurley

    Joined:
    Aug 29, 2011
    #6
    Can you please do a cat on your /etc/sysctl.conf and post the results?

    Did you have anything in it before making the mod?
     
  7. Tiki35 macrumors 6502

    Joined:
    Oct 25, 2009
    Location:
    Nanoose Bay, BC, Canada
    #7
    How about posting exactly what you did to fix it, rather than posting an arcane link to an article.
     
  8. funkahdafi thread starter macrumors 6502

    Joined:
    Mar 16, 2009
    Location:
    Planet Earth, Old World
    #8
    sysctl.conf was empty before doing this. I figure it just uses the BSD default values unless you change them. Here is what my sysctl.conf looks like now:

    Code:
    net.inet.tcp.delayed_ack=1
    kern.maxnbuf=60000
    kern.maxvnodes=280000
    net.inet.tcp.sendspace=2097152
    net.inet.tcp.recvspace=2097152
    net.inet.tcp.maxseg_unacked=32
    
    Note that I had to play around with the delayed_ack setting. Using different values here had dramatic effects on throughput and the value might have to be set differently on other machines.

    Also, the delayed_ack alone did not do anything. Only in combination with send and receive space did I manage to get it working.

    ----------

    Why is that link arcance? It's the internet. Why should I re-write here what's been written there?

    Basically I used the sysctl command in terminal to tweak some TCP settings (see above). Once I got them right, I put them in /etc/sysctl.conf to make them stick.
     
  9. johnhurley macrumors 6502a

    johnhurley

    Joined:
    Aug 29, 2011
    #9
    Thanks I am just starting to think about this area. New to apple's ... been supporting systems on solaris/linux for a long time.

    I have never seen a linux system with an empty ( nonexistent ) sysctl.conf so was pretty surprised to find I have no such file on my new macbook air 2011.
     
  10. funkahdafi thread starter macrumors 6502

    Joined:
    Mar 16, 2009
    Location:
    Planet Earth, Old World
    #10
    Yeah well actually OS X is based on a BSD variant (FreeBSD I believe). And Apple have changed A LOT. I think the TCP stack comes with a set of defaults that it uses when sysctl.conf is absent.

    That being said... People should only change this stuff in case there are problems. I just posted this so maybe someone who's in the same boat has a hint.

    Cheers
     
  11. shadyMedia macrumors newbie

    Joined:
    Apr 6, 2009
    #11
    Wow I always find it funny when people need to respond in such a dick way on forums. Maybe the guy just didn't understand what you wrote firstly. When ever I see replies like that and I know I can help the person out I always ignore it and I know there's other people that do the same. just saying lol
     
  12. phyrexia macrumors 6502a

    Joined:
    Sep 3, 2010
    #12
    The link you posted discusses problems with AFP and SMB, which are only used in LANs.

    The people in the thread you posted a link to are high fiving each other about their home network speed. The use of iperf in a LAN is demonstrated.

    :confused:
     
  13. funkahdafi thread starter macrumors 6502

    Joined:
    Mar 16, 2009
    Location:
    Planet Earth, Old World
    #13
    That's right, they discussed filesharing protocols on the local network. They all use TCP though and the tweaked parameters in sysctl.conf are for TCP, nor for filesharing protocols. Anything that uses TCP benefits from these tweaks.

    Note however: If it ain't broke, don't fix it. If you don't have any networking speed issues on your system, you don't need this.
     
  14. dyn macrumors 68030

    Joined:
    Aug 8, 2009
    Location:
    .nl
    #14
    I have read what you wrote but I can't say that you've read what I wrote nor the article you used. Read both again and try to comprehend what both say. From the information from you and that article I can't tell that it was a Lion/OS X upgrade problem and you actually fixed it. It might be the case but I can't tell for sure.

    Yes please think before you do something. You make a very common mistake beginners that have no idea what they are doing make: they trust tests from 3rd parties like their ISP. If there is 1 kind of test you should never ever trust are speedtests, especially when they are from your ISP! What do you think what happens when that test shows the reality, that people are not able to get the full speed of what the ISP says they offer? It is in the ISP's best interest to not display the actual speed but a far more positive one. If you do multiple speedtests from various 3rd parties and tools you'll see the difference. So yes, please think about what you are doing and try to comprehend how things work.

    But, if you have actually read my reply you'd have known I was talking about the technical part, not about the marketing part. That means I was talking about technical issues where some servers are slower than others. One of those things are the network links: their speed AND their LOAD (!!!!). If lots of people are connecting to that server and it can't keep up you will get slower speeds. It is like a bicycle: when you ride alone you can go very fast. Carry somebody and you won't be riding as fast. Same thing for other kind of vehicles.

    If you would have actually read my reply you'd also have known that I was talking about limiting your connections bandwidth and NOT the speedtest. This is common networking (see, it helps if you actually know what you are doing instead of copy-pasting stuff). ISP's offer different subscriptions with different bandwidths. When using something like fibre connections they run standard fibre cables that have a bandwidth of 10 Gbps. They won't give you that though. Instead they will limit the bandwidth to whatever is in your contract. Sometimes they screw up (I've seen it happen quite often) and people get stuck on a lower speed. If something is limited to a fixed speed of say, 50 Mbps it should ring some bells. In case of problems it is less likely that you'll see such a limitation, it is more likely that it will fluctuate. To give you an example: the Dutch ISP KPN offers fibre connections (ftth). You get internet (very fast ones), tv/radio and telephony. What they do is put separate VLANs on your connection: 1 for tv/radio, 1 for telephony and 1 for the standard internet connection. They do this because they can limit the bandwidth per VLAN. This way your internetconnection, telephony and radio/tv do not interfere. This means you can watch an HD movie, download like there is no tomorrow and make normal phone calls. They also offer these services on their DSL connections. They can't do it there and it causes problems when you try to do all these things. One of the reasons why most people on DSL will be limited to SD.

    It is very common that these kind of tests have fluctuating results. You need to take quite a lot of tests and from different parties to have some kind of certainty.

    Or the ISP fixed something or the load in the server was less or the load on the network between you and the server was less or... There are way too many variables that can explain why it is now fixed. You should have used various tests, not just 1. By using more than 1 you minimise this risk of problems.

    Just wanted to point out that this isn't a 10.7 problem but simply an OS X problem. 10.6 has the same kind of problem. The fact that you used 1 test is the big problem. If something is wrong with that test it will affect the results. If it spits out wrong results you come to wrong conclusions.

    The more reason to doubt that you actually fixed it by using those settings.
     
  15. funkahdafi thread starter macrumors 6502

    Joined:
    Mar 16, 2009
    Location:
    Planet Earth, Old World
    #15
    Dyn, I really don't like it if people try to tell me I am a beginner and that I don't understand what I am talking about. YOU are clearly not reading what I say and all you are doing here is trying to prove that you are right and other people are not.

    I've had a professional career in IT since 1993. I earn my daily living as a network engineer, designing and architecting large scale enterprise and carrier networks. I breathe TCP/IP and I eat network equipment for breakfast. I actually do know exactly what I am doing in this field and I know exactly when I see a problem and what's the root cause for that. So don't lecture me with your ignorant ********.

    Read the next two sentences very carefully, because they are all that count in this "discussion". And then keep on embarrassing yourself if you want.

    I had reproducible network performance issues. I applied the forementioned TCP parameters with sysctl and the problems went away.
     
  16. kildjean macrumors 6502

    kildjean

    Joined:
    Apr 16, 2005
    Location:
    Useless, TX
    #16
    Does anybody knows if these settings work under Yosemite 10.10:

    Code:
    net.inet.tcp.delayed_ack=1
    kern.maxnbuf=60000
    kern.maxvnodes=280000
    net.inet.tcp.sendspace=2097152
    net.inet.tcp.recvspace=2097152
    net.inet.tcp.maxseg_unacked=32
    
     

Share This Page