From the man page:
The binary protocol works a bit different than the textual protocol in the
way that a multiget is implemented as a pipe of single get-operations that
is sent to the server in a chunk. If you use large multigets you may improve
the latency by setting this value so that you send out the first chunk of
requests when you hit the specified limit, allowing the server to start
processing the request and send the data back while the rest of the
requests is created.
this value to high, may cause libmemcached to deadlock (trying to send
data, but the send will block because the input buffer in the kernel is full).
this value to high, may cause libmemcached to deadlock (trying to send
data, but the send will block because the input buffer in the kernel is full).
+=item MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
+
+The binary protocol works a bit different than the textual protocol in the
+way that a multiget is implemented as a pipe of single get-operations that
+is sent to the server in a chunk. If you use large multigets you may improve
+the latency by setting this value so that you send out the first chunk of
+requests when you hit the specified limit, allowing the server to start
+processing the request and send the data back while the rest of the
+requests is created.
+
=item MEMCACHED_BEHAVIOR_NOREPLY
Set this value to specify that you really don't care about the result
=item MEMCACHED_BEHAVIOR_NOREPLY
Set this value to specify that you really don't care about the result
new_clone->server_failure_limit= source->server_failure_limit;
new_clone->io_msg_watermark= source->io_msg_watermark;
new_clone->io_bytes_watermark= source->io_bytes_watermark;
new_clone->server_failure_limit= source->server_failure_limit;
new_clone->io_msg_watermark= source->io_msg_watermark;
new_clone->io_bytes_watermark= source->io_bytes_watermark;
+ new_clone->io_key_prefetch= source->io_key_prefetch;
if (source->hosts)
rc= memcached_server_push(new_clone, source->hosts);
if (source->hosts)
rc= memcached_server_push(new_clone, source->hosts);
uint32_t server_failure_limit;
uint32_t io_msg_watermark;
uint32_t io_bytes_watermark;
uint32_t server_failure_limit;
uint32_t io_msg_watermark;
uint32_t io_bytes_watermark;
+ uint32_t io_key_prefetch;
time_t next_distribution_rebuild;
};
time_t next_distribution_rebuild;
};
case MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK:
ptr->io_bytes_watermark= (int32_t)data;
break;
case MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK:
ptr->io_bytes_watermark= (int32_t)data;
break;
+ case MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH:
+ ptr->io_key_prefetch = (int32_t)data;
+ break;
case MEMCACHED_BEHAVIOR_SND_TIMEOUT:
ptr->snd_timeout= (int32_t)data;
break;
case MEMCACHED_BEHAVIOR_SND_TIMEOUT:
ptr->snd_timeout= (int32_t)data;
break;
return ptr->io_msg_watermark;
case MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK:
return ptr->io_bytes_watermark;
return ptr->io_msg_watermark;
case MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK:
return ptr->io_bytes_watermark;
+ case MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH:
+ return ptr->io_key_prefetch;
case MEMCACHED_BEHAVIOR_BINARY_PROTOCOL:
temp_flag= MEM_BINARY_PROTOCOL;
break;
case MEMCACHED_BEHAVIOR_BINARY_PROTOCOL:
temp_flag= MEM_BINARY_PROTOCOL;
break;
MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT,
MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK,
MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK,
MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT,
MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK,
MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK,
+ MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH,
MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY,
MEMCACHED_BEHAVIOR_NOREPLY,
MEMCACHED_BEHAVIOR_USE_UDP,
MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY,
MEMCACHED_BEHAVIOR_NOREPLY,
MEMCACHED_BEHAVIOR_USE_UDP,
if ((memcached_io_write(&ptr->hosts[server_key], request.bytes,
sizeof(request.bytes), 0) == -1) ||
(memcached_io_write(&ptr->hosts[server_key], keys[x],
if ((memcached_io_write(&ptr->hosts[server_key], request.bytes,
sizeof(request.bytes), 0) == -1) ||
(memcached_io_write(&ptr->hosts[server_key], keys[x],
- key_length[x], flush) == -1))
+ key_length[x],
+ flush || (x > 0 && x == ptr->io_key_prefetch)) == -1))
{
memcached_server_response_reset(&ptr->hosts[server_key]);
rc= MEMCACHED_SOME_ERRORS;
{
memcached_server_response_reset(&ptr->hosts[server_key]);
rc= MEMCACHED_SOME_ERRORS;
assert(clone->hash_continuum == memc->hash_continuum);
assert(clone->io_bytes_watermark == memc->io_bytes_watermark);
assert(clone->io_msg_watermark == memc->io_msg_watermark);
assert(clone->hash_continuum == memc->hash_continuum);
assert(clone->io_bytes_watermark == memc->io_bytes_watermark);
assert(clone->io_msg_watermark == memc->io_msg_watermark);
+ assert(clone->io_key_prefetch == memc->io_key_prefetch);
assert(clone->on_cleanup == memc->on_cleanup);
assert(clone->on_clone == memc->on_clone);
assert(clone->poll_timeout == memc->poll_timeout);
assert(clone->on_cleanup == memc->on_cleanup);
assert(clone->on_clone == memc->on_clone);
assert(clone->poll_timeout == memc->poll_timeout);