Re: tuning TCP/IP performance from Carbon app.
Re: tuning TCP/IP performance from Carbon app.
- Subject: Re: tuning TCP/IP performance from Carbon app.
- From: Quinn <email@hidden>
- Date: Tue, 13 May 2003 09:05:21 +0100
At 15:30 -0400 12/5/03, Doug Hill wrote:
On OS X I find I need to change completely different options [which makes
sense I guess since the IP stacks are of totally different origin].
net.inet.tcp.delayed_ack
net.inet.tcp.recvspace
net.inet.tcp.sendspace
net.inet.udp.recvspace
I have found the various options that are supported by OTOptionManagement
that correspond to options supported by setsockopt(), e.g. SO_RCVBUF ==
XTI_RCVBUF, etc. But, for example, how do I turn off delayed ACKs using OT?
These are not socket options, but are sysctl variables. You change
them using sysctl. See "man 8 sysctl" and "man 3 sysctl" for details.
The sysctl API is part of the System framework. To call it from a
CFM application you'll need to jump through the standard
CFM-to-Mach-O hoops.
<
http://developer.apple.com/samplecode/Sample_Code/Runtime_Architecture/CallMachOFramework.htm>
However, changing most sysctl variables requires you to be running as
root (that is, your process's EUID must be 0). Our recommended
approach for doing this is to create a setuid root helper tool, as
shown by the MoreAuthSample code.
<
http://developer.apple.com/samplecode/Sample_Code/Security/MoreAuthSample.htm>
This has the advantage that the tool will be Mach-O, and thus can
call sysctl without any glue. However, the MoreAuthSample code
(required to call the tool) makes *lots* of Mach-O-only calls. The
best approach, IMHO, is to factor all of this Mach-O code into a
Mach-O bundle, and load and call that bundle via the CFBundle APIs
(which are simple to use and available to CFM applications).
I have a sample that shows how to do this. I intend to publish the
sample soon (in the next week or so). I'll email you a copy directly.
S+E
--
Quinn "The Eskimo!" <
http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.