Difference between revisions of "TigerPage"

From Wikifications
Jump to: navigation, search
(ipfw / dummynet)
Line 21: Line 21:
 
* bandwidth limiting based on UID of socket owner
 
* bandwidth limiting based on UID of socket owner
 
* dynamically viewing / adjusting xfer rates in realtime
 
* dynamically viewing / adjusting xfer rates in realtime
 +
 +
==== Basic Rate Limiting ====
 +
Scenario: I want to limit outgoing bandwidth from a specific service port so it does not saturate my link and lag my ssh sessions. Add the following ipfw rules on the machine hosting the service.
 +
 +
ipfw add pipe 10 ip from any pdps to any
 +
ipfw pipe 10 config bw 40Kbyte/s queue 50KBytes
 +
 +
Where: "pdps" is the service port I'm using (defined in /etc/services); 40Kbyte/s is the rate limit, and 50Kbytes is the size of the queue
 +
 +
Observe your queues as follows:
 +
root@idio[~]ipfw queue show
 +
00010: 320.000 Kbit/s    0 ms  50 KB 1 queues (1 buckets) droptail
 +
    mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000
 +
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
 +
  0 tcp      72.1.149.40/1314    17.216.21.158/50768 11547 16745978 15 22500  5
 +
 +
I'm just getting start on this stuff, the possibilities are endless :)
  
 
== sys administration ==
 
== sys administration ==

Revision as of 15:11, 24 June 2005

This will be populated slowly with my own observations / tips, etc about Tiger.

Metadata / Spotlight

The "Smart Folder" UI does not let you create compound queries with nested logic or "OR". Everything is at the same 'level' of evaluation (in the 'order of operations' sense), and everything is ANDed.

However, the underlying APIs fully support such queries, e.g.:

mdfind -onlyin /Users/andre/foodle "kMDItemFSOwnerUserID == 501 || kMDItemFSOwnerGroupID == 18010"

It is also possible to edit the .savedSearch file that Finder creates when saving a Smart Folder.

Here is an example of an updated "string" attribute from a .savedSearch file that uses an OR:

<string>((kMDItemFSContentChangeDate >= $time.today) &#124;&#124; (kMDItemFSCreationDate >= $time.today)) &amp;&amp; (kMDItemContentType != com.apple.mail.emlx) && (kMDItemContentType != public.vcard)</string>

(note also the use of &#38; to get a literal ampersand in html, heh)

networking

ipfw / dummynet

  • bandwidth limiting based on UID of socket owner
  • dynamically viewing / adjusting xfer rates in realtime

Basic Rate Limiting

Scenario: I want to limit outgoing bandwidth from a specific service port so it does not saturate my link and lag my ssh sessions. Add the following ipfw rules on the machine hosting the service.

ipfw add pipe 10 ip from any pdps to any
ipfw pipe 10 config bw 40Kbyte/s queue 50KBytes

Where: "pdps" is the service port I'm using (defined in /etc/services); 40Kbyte/s is the rate limit, and 50Kbytes is the size of the queue

Observe your queues as follows:

root@idio[~]ipfw queue show
00010: 320.000 Kbit/s    0 ms  50 KB 1 queues (1 buckets) droptail
    mask: 0x00 0x00000000/0x0000 -> 0x00000000/0x0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
  0 tcp      72.1.149.40/1314    17.216.21.158/50768 11547 16745978 15 22500   5

I'm just getting start on this stuff, the possibilities are endless :)

sys administration

launchd

The One True Solution to process management

dsidentity

For all your cli user record manipulation needs