new server snapshot

Anatoly Vorobey mellon@pobox.com
Wed, 13 Aug 2003 12:46:22 +0300


On Tue, Aug 12, 2003 at 05:38:10PM -0700, Brad Fitzpatrick wrote:
> * It's much faster, using TCP_CORK on Linux, TCP_NOPUSH on BSD, and
>   TCP_NODELAY everywhere else.

So what do you want to do with the write-combining code I sent the
other day? I can make it refrain from combining writes if TCP_CORK
is on, but do it if TCP_NODELAY is used... seems to be the best option, 
no?

> * autoconf needs to --disable-static on OS X, because Darwin doesn't
>   support static binaries.

What, no static binaries at all? Amazing.

Also, this little patch is almost cosmetic, but it moves the uncorking
to the right place, from the code design point of view. 

main <- wcmtools          src/memcached/memcached.c
--- src/memcached/memcached.c	2003-08-13 12:36:23.000000000 +0300
+++ cvs/wcmtools/memcached/memcached.c	2003-08-13 12:39:35.000000000 +0300
@@ -933,6 +933,8 @@
                     c->write_and_free = 0;
                 }
                 c->state = c->write_and_go;
+                if (c->state == conn_read)
+                    set_cork(c, 0);
                 break;
             }
             res = write(c->sfd, c->wcurr, c->wbytes);
@@ -940,8 +942,6 @@
                 stats.bytes_written += res;
                 c->wcurr  += res;
                 c->wbytes -= res;
-                if (c->wbytes == 0 && c->write_and_go == conn_read)
-                    set_cork(c, 0);
                 break;
             }
             if (res == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) {