Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

eyoungren

macrumors Penryn
Original poster
Aug 31, 2011
29,719
28,514
Thought I might offer this tonight. This is code that runs on all my PowerPC Macs on boot. Certain commands are OS relevant so you may have to experiement if you need to by removing each offending line. It's shell script code inside Applescript.

The idea here is to improve network speed, something I was frustratingly trying to do for years with a G4 on a PC network.

Copy. Open Script Editor. Paste. In the 'XXXXX' areas for user name and password enter the username (account name, not the shortname) and password. Compile and save as an app. I uncheck 'Stay Open' (you don't want this to hang around). Also, if you check 'Run Only' you won't be able to open the app in Script Editor again.

Save the app somewhere and then add it to your boot items in your user account. It will execute each time you boot.

You may notice a boost, you may not - it's no panacea. But it's made things tolerable for me.

AppleScript:
do shell script "sysctl -w net.inet.tcp.delayed_ack=2" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.mssdflt=1440" user name "XXXXX" password "XXXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.sendspace=524288" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.recvspace=524288" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.udp.maxdgram=57344" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w kern.maxproc=2048" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w kern.maxprocperuid=512" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w kern.ipc.maxsockbuf=2097152" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w kern.ipc.somaxconn=1024" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.rfc1323=1" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.always_keepalive=1" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.keepintvl=150" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.slowstart_flightsize=4" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.strict_rfc1948=1" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.rfc1644=1" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.newreno=1" user name "XXXXX" password "XXXXX" with administrator privileges
 
Last edited:
How did you find these out, and what do they all mean?
They are various TCP/IP hacks. Originally, the G4 I was using was on Tiger and Tiger has issues with Windows Server 2003 SBS. So, just a lot of downtime Google searching for do shellscript commands to try and get as much out of the connection as I could.

The annoying part that took the longest was the username with password with administrator privileges part. I'm wrapping this in Applescript (so it'll run as an app and execute the commands on login) but Terminal doesn't like executing the commands passed to it from an Applescript with the standard user. Finding that particular bit is what enables it to run without user interaction.

EDIT: It's the same kind of thing we are both trying to do to TenFourFox. Keep alive, max connections, connection size, transmit/receive sizes, etc, etc. If you do a Google search for each command you should find them.
 
@eyoungren May I use this in the redesigned AquaTrimcelerator? You will be credited in full.
Absolutely, but don't credit me. Those were all things I found via Google searches. It's not my work, I just found it on other people's websites.
 
@eyoungren If you insist ...
You can mention that I collected the commands (however you want to word that) and created the Applescript using stock shell script phrasing, but I didn't actually come up with the commands themselves or the values. I just stumbled across them.
 
Thought I migfht offer this tonight. This is code that runs on all my PowerPC Macs on boot. Certain commands are OS relevant so you may have to experiement if you need to by removing each offending line. It's shell script code inside Applescript.

The idea here is to improve network speed, something I was frustratingly trying to do for years with a G4 on a PC network.

Copy. Open Script Editor. Paste. In the 'XXXXX' areas for user name and password enter the username (account name, not the shortname) and password. Compile and save as an app. I uncheck 'Stay Open' (you don't want this to hang around). Also, if you check 'Run Only' you won't be able to open the app in Script Editor again.

Save the app somewhere and then add it to your boot items in your user account. It will execute each time you boot.

You may notice a boost, you may not - it's no panacea. But it's made things tolerable for me.

AppleScript:
do shell script "sysctl -w net.inet.tcp.delayed_ack=2" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.mssdflt=1440" user name "XXXXX" password "XXXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.sendspace=524288" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.recvspace=524288" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.udp.maxdgram=57344" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w kern.maxproc=2048" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w kern.maxprocperuid=512" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w kern.ipc.maxsockbuf=2097152" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w kern.ipc.somaxconn=1024" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.rfc1323=1" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.always_keepalive=1" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.keepintvl=150" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.slowstart_flightsize=4" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.strict_rfc1948=1" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.rfc1644=1" user name "XXXXX" password "XXXXX" with administrator privileges
do shell script "sysctl -w net.inet.tcp.newreno=1" user name "XXXXX" password "XXXXX" with administrator privileges

This is nifty. Thank you for sharing it!

Have you ever applied this to older Intel systems running Snow Leopard, or have you kept it solely to your PPC Tiger/Leopard boxes?
 
  • Like
Reactions: eyoungren
This is nifty. Thank you for sharing it!

Have you ever applied this to older Intel systems running Snow Leopard, or have you kept it solely to your PPC Tiger/Leopard boxes?
Honestly, the thought hadn't occurred to me to try it on my Intels until yesterday. Was going to give it a go today and see. When I transitioned, it's one of those things that fell through the cracks.

I do believe it's on my SL MBP though. But I shut that down a while back so I will have to check later.
 
  • Like
Reactions: B S Magnet
Have you ever applied this to older Intel systems running Snow Leopard, or have you kept it solely to your PPC Tiger/Leopard boxes?
OK. So, had to remove three commands that High Sierra no longer recognizes and resave as a new app. The old one was PowerPC code so wasn't running.

Will see how this goes.
 
  • Like
Reactions: B S Magnet
OK. So, had to remove three commands that High Sierra no longer recognizes and resave as a new app. The old one was PowerPC code so wasn't running.

Will see how this goes.

Test comparisons between before/after on boxes running High Sierra may eventually become relevant when I bump my A1278 MBP from Snow Leopard/Sierra dual boot to SL/HS, though the big bottleneck on there is usually the integrated graphics and less so the network.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.