OS X 10.4.2, storing objects roughly over 32K ...

James Robinson jlrobins at socialserve.com
Tue Aug 30 21:32:59 PDT 2005


To update myself, I have gotten things rolling based on advice found:

     http://lists.danga.com/pipermail/memcached/2005-March/001292.html

With set_cork() defined as:

void set_cork(conn *c, int val) {
    if (c->is_corked == val) return;
    c->is_corked = val;

    val = ~val;
    setsockopt(c->sfd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val));
}

stores of payload between 14000 and 195846 bytes all happen on OS X  
without delay. Apparently OS X's TCP_NOPUSH is just plain busted, as  
seems to be the net wisdom garnered from google.

---
import memcache
import time
import socket

c = memcache.Client(['127.0.0.1:11211'])

for i in (32641, 32639, 16000, 14000, 18000, 32641, 32644,55000,  
32641 * 2, 32641 * 4, 32641 * 6):
     val = 's' * i
     t1 = time.time()
     c.set(i,val)
     t2= time.time()
     print "%d store took %s seconds" % (i, t2  - t1)
---

32641 store took 0.00501680374146 seconds
32639 store took 0.00244212150574 seconds
16000 store took 0.00187420845032 seconds
14000 store took 0.00256204605103 seconds
18000 store took 0.00198698043823 seconds
32641 store took 0.00225687026978 seconds
32644 store took 0.00342202186584 seconds
55000 store took 0.00297403335571 seconds
65282 store took 0.0147829055786 seconds
130564 store took 0.00387501716614 seconds
195846 store took 0.025102853775 seconds



----
James Robinson
Socialserve.com



More information about the memcached mailing list