| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
`watch deletions`: would log all keys which are deleted using either `delete` or `md` command.
The log line would contain the command used, the key, the clsid and size of the deleted item.
Items which result in delete miss or are marked as stale wouldn't show up in the logs
|
|
|
|
|
|
|
|
|
| |
Sending 's' flag to metaset now returns the size of the item stored.
Useful if you want to know how large an append/prepended item now is.
If the 'N' flag is supplied while in append/prepend mode, allows
autovivifying (with exptime supplied from N) for append/prepend style
keys that don't need headers created first.
|
| |
|
| |
|
|
|
|
|
|
|
| |
proxy_req_active shows the number of active proxy requests, but if those
proxy requests make sub-requests via mcp.await() they are not accounted
for. This gives the number of await's active, but not the total number
of in-flight async requests.
|
|
|
|
|
|
|
|
|
| |
xml2rfc's toolchain has bitrotted and I don't intend on changing the
binary protocol documentation anymore. Instead I've included the .txt
files from 1.6.16 and commented out the build docs.
Even if I adjust the call args for xml2rfc it complains about the
copyright being old and I don't want to think about that :(
|
| |
|
|
|
|
|
|
|
|
|
| |
delete the magic logging and require mcp.log_req* be used if you want
those types of entries to appear. keeps a separate data stream from
"proxyuser" just in case that's useful.
proxycmds wasn't able to get enough context to autogenerate useful log
lines, so I'd rather not have it in there at all.
|
| |
|
|
|
|
| |
see doc/protocol.txt
|
| |
|
|
|
|
|
|
| |
Add two new stat keys, `store_too_large` and `store_no_memory`, to track
occurrences of storage request rejections due to writing too large of a
value and writing beyond available provisioned memory, respectively.
|
|
|
|
|
| |
The stat key `log_watchers` indicates the number of active connected
`watch` clients.
|
|
|
|
|
|
|
| |
`-o ssl_min_version` can be used to configure the server to only accept
handshakes from clients with a minimum TLS protocol version. Currently
supported options are TLS v1.0, TLS v1.1, TLS v1.2, and TLS v1.3
(OpenSSL 1.1.1+ only).
|
|
|
|
|
|
|
|
| |
Add support for `watch connevents` to report opened (`conn_new`)
and closed (`conn_close`) client connections. Event log lines indicate
the connection's remote IP, remote port, and transport type.
`conn_close` events additionally supply a reason for the closing the
connection.
|
|
|
|
|
| |
Note: Do not fix typos in crc32.c because it's copied from an upstream
source
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I had the response code as "HD" in the past, but standardized on OK
while merging a number of "OK-like" rescodes together. This was a
mistake; as many "generic" memcached response codes use "OK". Most of
these are management or specialized uncommon commands.
With this, a client response parser can know for sure if a response is
to a meta command, or some other command.
`-o meta_response_old` starttime option has been added, valid for the
next 3 months, which switches the response code back from HD to OK. In
case any existing users depended on this and need time to migrate.
|
|
|
|
|
|
|
| |
payload length is now part of the main command rather than a flag/token
pair. This allows byte swallow to be more reliable in the case of a flag
parsing error, and makes sets easier to parse and buffer for servers
implementing the protocol.
|
|
|
|
|
| |
cachedump was the only place in the codebase I can find which copied
the key verbatim. wonder when I can finally remove the command :)
|
| |
|
| |
|
|
|
|
|
|
|
| |
specifying 'hash' instead of 'all' will make the LRU crawler iterate
over ever bucket in the hash table once, instead of what's in the LRU.
This also doesn't suffer from missing items because of LRU reordering
or high lock contention.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By default memcached assigns connections to worker threads in
a round-robin manner. This patch introduces an option to select
a worker thread based on the incoming connection's NAPI ID if
SO_INCOMING_NAPI_ID socket option is supported by the OS.
This allows a memcached worker thread to be associated with a
NIC HW receive queue and service all the connection requests
received on a specific RX queue. This mapping between a memcached
thread and a HW NIC queue streamlines the flow of data from the
NIC to the application. In addition, an optimal path with reduced
context switches is possible, if epoll based busy polling
(sysctl -w net.core.busy_poll = <non-zero value>) is also enabled.
This feature is enabled via a new command line parameter -N <num>
or "--napi_ids=<num>", where <num> is the number of available/assigned
NIC hardware RX queues through which the connections can be received.
The number of napi_ids specified cannot be greater than the number
of worker threads specified using -t/--threads option.
If the option is not specified, or the conditions not met, the code
defaults to round robin thread selection.
Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
|
|
|
|
|
|
|
|
|
|
| |
The list grows toward next, not prev. Also wasn't zeroing out next ptr.
Also didn't unmark free for first resp object. (thanks Prudhviraj!)
Adds a couple counters so users can tell if something is wrong as well.
response_obj_count is solely for response objects in-flight, they
should not be held when idle (except for one bundle per worker thread).
|
|
|
|
|
|
| |
accept but warn if the commandline is used. also keeps the oom counter
distinct so users have a chance of telling what type of memory pressure
they're under.
|
| |
|
| |
|
|
|
|
| |
Enables server-side TLS session caching.
|
| |
|
|
|
|
| |
links to a forwarder for the wiki page.
|
|
|
|
| |
Thanks to @shivnagarajan
|
|
|
|
|
| |
see doc/protocol.txt. needed slightly different code as we have to
generate the response line after the main operation completes.
|
|
|
|
|
|
|
|
| |
do_store_item's logic was really hard to follow. This is nearly the
same logic but split out to be more clear.
Also adds the mode switch for mset, so we get
add/append/prepend/replace without separate top level commands.
|
|
|
|
|
|
|
|
|
|
|
| |
allows specifying a megabyte limit for either response objects or read
buffers. this is split among all of the worker threads.
useful if connection limit is extremely high and you want to
aggressively close connections if something
happens and all connections become active at the same time.
missing runtime tuning.
|
|
|
|
|
|
|
|
|
|
| |
ST/DE/HD all mean "okay". EX/NF/etc are already reused.
VA has different response parsing. EN/MN are specific.
future commands should be able to reuse most of these. In the odd case
new ones are added, clients would have to be updated. Generally they
shouldn't have to be.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
remove EN\r\n trailer from valid mg responses. VA is the status code, EN is
redundant. quiet mode elides the EN on miss.
meta-noop now has a dedicated MN status code for clarity.
fix bug in return data for "mg key\r\n"
updates tests for new changes.
also updates documentation.
|
|
|
|
|
|
|
|
|
|
|
|
| |
instead of 2k and then realloc all over every time you set a large
item, or do large pipelined fetches, use a static slightly larger
buffer.
Idle connections no longer hold a buffer, freeing up a ton of memory.
To maintain compatibility with unbound ASCII multigets, those fall back
to the old malloc/realloc/free routine which it's done since the dark
ages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change refactors most of memcached's networking frontend code. The
goals with this change:
- Decouple buffer memory from client connections where plausible,
reducing memory usage for currently inactive TCP sessions.
- Allow easy response stacking for all protocols. Previously every
binary command generates a syscall during response. This is no longer
true when multiple commands are read off the wire at once. The new meta
protocol and most text protocol commands are similar.
- Reduce code complexity for network handling. Remove automatic buffer
adjustments, error checking, and so on.
This is accomplished by removing the iovec, msg, and "write buffer"
structures from connection objects. A `mc_resp` object is now used to
represent an individual response. These objects contain small iovec's
and enough detail to be late-combined on transmit. As a side effect,
UDP mode now works with extstore :)
Adding to the iovec always had a remote chance of memory failure, so
every call had to be checked for an error. Now once a response object
is allocated, most manipulations can happen without any checking. This
is both a boost to code robustness and performance for some hot paths.
This patch is the first in a series, focusing on the client response.
|
|
|
|
|
|
| |
This limit was added in this patch [1], while this patch [2] fixed it in -h output.
[1] https://github.com/memcached/memcached/commit/b5ad069ed887b8086756def7fb2efa65f5c1e462#diff-3970a0b3806605c2c138450fdae4e80e
[2] https://github.com/memcached/memcached/commit/50bdc9f3e134122e280031683f2b502f84e96624#diff-3970a0b3806605c2c138450fdae4e80e
|
|
|
|
|
|
|
|
|
| |
As per request here:
https://github.com/memcached/memcached/pull/554#issuecomment-543362675
NB: Using wildcards for dependencies with Automake is not recommended
and should be considered fragile. However, for this particular case it
seems to work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- I get this warning when building the docs:
WARNING: No DTD given, defaulting to
/usr/lib/python3.7/site-packages/xml2rfc/templates/rfc2629.dtd
- Patching Makefile.am to use the local DTD gives the below error:
ERROR: Unable to validate the XML document: protocol-binary.full
protocol-binary.full: Line 2: Value "trust200902" for attribute ipr of
rfc is not among the enumerated set
- This commit suggests that you prefer to use a local copy of the DTD.
commit fe2629fd3fcdbde49f4016635866bd3488be88b0
Author: Steve Wills <steve@mouf.net>
Date: Wed Jul 23 19:21:40 2014 +0000
keep local copies of dtd and use it
This commit ensures we don't rely on and external site for the docs
to build.
If that site were to go away, we wouldn't be able to build docs.
- Hence, update the DTD too.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Out-of-tree build didn't work for doc/ since $(srcdir) was not prepended
to the source files.
This solution uses pattern substitutions and make automatic variables.
Here 'make' will use VPATH (set by Automake) so $(srcdir) isn't needed.
Remove use of wildcards, Automake does not support them.
https://www.gnu.org/software/automake/manual/html_node/Wildcards.html
Always include built specifications when make dist.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- we get asked a lot to provide a "metaget" command, for various uses
(debugging, etc)
- we also get asked for random one-off commands for various use cases.
- I really hate both of these situations and have been wanting to
experiment with a slight tuning of how get commands work for a long
time.
Assuming that if I offer a metaget command which gives people the
information they're curious about in an inefficient format, plus data
they don't need, we'll just end up with a slow command with
compatibility issues. No matter how you wrap warnings around a command,
people will put it into production under high load. Then I'm stuck with
it forever.
Behold, the meta commands!
See doc/protocol.txt and the wiki for a full explanation and examples.
The intent of the meta commands is to support any features the binary
protocol had over the text protocol. Though this is missing some
commands still, it is close and surpasses the binary protocol in many
ways.
|
|
|
|
|
|
| |
this is helpful when it's required to identify which clients are
connected to which server address when memcached listens on
multiple addresses
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mem_requested is an oddball counter: it's the total number of bytes
"actually requested" from the slab's caller. It's mainly used for a
stats counter, alerting the user that the slab factor may not be
efficient if the gap between total_chunks * chunk_size - mem_requested
is large.
However, since chunked items were added it's _also_ used to help the
LRU balance itself. The total number of bytes used in the class vs the
total number of bytes in a sub-LRU is used to judge whether to move
items between sub-LRU's.
This is a layer violation; forcing slabs.c to know more about how items
work, as well as EXTSTORE for calculating item sizes from headers.
Further, it turns out it wasn't necessary for item allocation: if we
need to evict an item we _always_ pull from COLD_LRU or force a move
from HOT_LRU. So the total doesn't matter.
The total does matter in the LRU maintainer background thread. However,
this thread caches mem_requested to avoid hitting the slab lock too
frequently. Since sizes_bytes[] within items.c is generally redundant
with mem_requested, we now total sizes_bytes[] from each sub-LRU before
starting a batch of LRU juggles.
This simplifies the code a bit, reduces the layer violations in slabs.c
slightly, and actually speeds up some hot paths as a number of branches
and operations are removed completely.
This also fixes an issue I was having with the restartable memory
branch :) recalculating p->requested and keeping a clean API is painful
and slow.
NOTE: This will vary a bit compared to what mem_requested originally
did, mostly for large chunked items.
For items which fit inside a single slab chunk, the stat is identical.
However, items constructed by chaining chunks will have a single large
"nbytes" value and end up in the highest slab class. Chunked items can
be capped with chunks from smaller slab classes; you will see
utilization of chunks but not an increase in mem_requested for them.
I'm still thinking this through but this is probably acceptable. Large
chunked items should be accounted for separately, perhaps with some new
counters so they can be discounted from normal calculations.
|
| |
|
|
|
|
|
|
| |
Has defaulted to false since 1.5.0, and with -o modern for a few years
before that. Performance is fine, no reported bugs. Always was the
intention. Code is simpler without the options.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Loads "username:password\n" tokens (up to 8) out of a supplied authfile.
If enabled, disables binary protocol (though may be able to enable both
if sasl is also used?).
authentication is done via the "set" command. A separate handler is
used to avoid some hot path conditionals and narrow the code
executed in an unauthenticated state.
ie:
set foo 0 0 7\r\n
foo bar\r\n
returns "STORED" on success. Else returns CLIENT_ERROR with some
information.
Any key is accepted: if using a client that doesn't try to authenticate
when connecting to a pool of servers, the authentication set can be
tried with the same key as one that failed to coerce the client to
routing to the correct server. Else an "auth" or similar key would
always go to the same server.
|