168 Commits

Author SHA1 Message Date
antirez
c8304b099d RESP3: most null replies converted. 2019-01-09 17:00:29 +01:00
antirez
711abc03f1 RESP3: Use new deferred len API in object.c. 2019-01-09 17:00:29 +01:00
zhaozhao.zz
1e8605400b MEMORY command: make USAGE more accurate
In MEMORY USAGE command, we count the key argv[2] into usage,
but the argument in command may contains free spaces because of
sdsMakeRoomFor. But the key in db never contains free spaces
because we use sdsdup when dbAdd, so using the real key to
count the usage is more accurate.
2018-11-29 01:01:51 +08:00
antirez
3fd976a78c MEMORY command: make strcasecmp() conditional like the following. 2018-11-06 18:15:51 +01:00
Salvatore Sanfilippo
5dd561b484 Merge pull request #4526 from itamarhaber/memory_help
Standardizes `MEMORY HELP` subcommand
2018-11-06 18:13:17 +01:00
Salvatore Sanfilippo
f588805a52 Merge pull request #5453 from damz/pr/aof-buffer-evict
Overhead is the allocated size of the AOF buffer, not its length
2018-10-24 12:28:28 +02:00
Damien Tournoud
8b3154a0ea Overhead is the allocated size of the AOF buffer, not its length 2018-10-16 11:47:42 -07:00
hujiecs
57e64d5e62 several typos fixed, optimize MSETNX to avoid unnecessary loop 2018-10-16 15:48:03 +08:00
Salvatore Sanfilippo
159531c1c9 Merge pull request #5242 from oranagra/script_mem
script cache memory in INFO and MEMORY includes both script code and overheads
2018-10-02 16:03:05 +02:00
antirez
e670825ef9 Slave removal: remove slave from object.c. 2018-09-11 15:32:28 +02:00
Oran Agra
cdda01edef script cache memory in INFO and MEMORY includes both script code and overheads 2018-08-13 17:36:54 +03:00
antirez
d1e07d021e Change 42 to 1000 as warning level for cached scripts.
Related to #4883.
2018-07-23 18:44:58 +02:00
Salvatore Sanfilippo
63171b81b0 Merge pull request #4883 from itamarhaber/lua_scripts-in-info-memory
Adds memory information about the scripts' cache to INFO
2018-07-23 18:43:05 +02:00
Itamar Haber
a3c4ec8a84 Adds Lua overheads to MEMORY STATS, smartens the MEMORY DOCTOR 2018-07-22 21:16:00 +03:00
antirez
938d879c2a addReplySubSyntaxError() renamed to addReplySubcommandSyntaxError(). 2018-07-02 18:49:34 +02:00
Salvatore Sanfilippo
c44be0ab9b Merge pull request #4998 from itamarhaber/module_command_help
Module command help
2018-07-02 18:46:56 +02:00
Salvatore Sanfilippo
782db3117e Merge pull request #5051 from oranagra/streams_mem_estimate
fix streams memory estimation, missing raxSeek
2018-06-21 17:36:28 +02:00
Oran Agra
74c1fbbb9b fix streams memory estimation, missing raxSeek 2018-06-21 17:58:29 +03:00
Guy Benoish
4330bc3e3a Enhance RESTORE with RDBv9 new features
RESTORE now supports:
1. Setting LRU/LFU
2. Absolute-time TTL

Other related changes:
1. RDB loading will not override LRU bits when RDB file
   does not contain the LRU opcode.
2. RDB loading will not set LRU/LFU bits if the server's
   maxmemory-policy does not match.
2018-06-20 15:11:08 +07:00
antirez
1c783a2051 Refactor createObjectFromLongLong() to be suitable for value objects. 2018-06-18 16:55:16 +02:00
Itamar Haber
8f2e77dd23 Globally applies addReplySubSyntaxError 2018-06-07 18:39:36 +03:00
Salvatore Sanfilippo
bd1cba552f Merge pull request #4953 from soloestoy/fix-memory-overhead
MEMORY: fix the missing of monitor clients buffers
2018-05-31 17:31:24 +02:00
antirez
eb71d70571 Capitalize OBJECT HELP subcommands. 2018-05-31 17:11:46 +02:00
zhaozhao.zz
562a2931e7 MEMORY: fix the missing of monitor clients buffers 2018-05-27 16:34:58 +08:00
Salvatore Sanfilippo
2ceff42a53 Merge pull request #4703 from gechunlin/unstable
Update object.c
2018-03-22 16:32:45 +01:00
Salvatore Sanfilippo
d799fdf733 Merge pull request #4691 from oranagra/active_defrag_v2
Active defrag v2
2018-03-22 09:16:32 +01:00
antirez
18b62c3abd Streams: improve MEMORY USAGE computation, include CGs. 2018-03-20 17:50:40 +01:00
Oran Agra
5805907825 Adding real allocator fragmentation to INFO and MEMORY command + active defrag test
other fixes / improvements:
- LUA script memory isn't taken from zmalloc (taken from libc malloc)
  so it can cause high fragmentation ratio to be displayed (which is false)
- there was a problem with "fragmentation" info being calculated from
  RSS and used_memory sampled at different times (now sampling them together)

other details:
- adding a few more allocator info fields to INFO and MEMORY commands
- improve defrag test to measure defrag latency of big keys
- increasing the accuracy of the defrag test (by looking at real grag info)
  this way we can use an even lower threshold and still avoid false positives
- keep the old (total) "fragmentation" field unchanged, but add new ones for spcific things
- add these the MEMORY DOCTOR command
- deduct LUA memory from the rss in case of non jemalloc allocator (one for which we don't "allocator active/used")
- reduce sampling rate of the rss and allocator info
2018-03-12 15:08:52 +02:00
Salvatore Sanfilippo
601420cb73 Merge pull request #3828 from oranagra/sdsnewlen_pr
add SDS_NOINIT option to sdsnewlen to avoid unnecessary memsets.
2018-02-27 04:04:32 -08:00
gechunlin
c3ea278f44 Update object.c 2018-02-22 20:57:54 -06:00
Salvatore Sanfilippo
65c86ab4a4 Merge pull request #3745 from guybe7/unstable
enlarged buffer given to ld2string
2018-02-13 15:50:21 +01:00
gnuhpc
35b38d789a Fix memory usage list bug 2018-01-05 12:16:24 +08:00
Itamar Haber
8f4aff385c Uppercases subcommands in OBJECT HELP 2017-12-15 21:21:12 +02:00
Itamar Haber
3c860af353 Uppercases subcommands in MEMORY HELP 2017-12-15 21:19:41 +02:00
Itamar Haber
17c8ff5a1c Standardizes MEMORY HELP subcommand 2017-12-10 17:54:56 +02:00
antirez
eeb4bcbd85 Change indentation and other minor details of PR #4489.
The main change introduced by this commit is pretending that help
arrays are more text than code, thus indenting them at level 0. This
improves readability, and is an old practice when defining arrays of
C strings describing text.

Additionally a few useless return statements are removed, and the HELP
subcommand capitalized when printed to the user.
2017-12-06 12:05:14 +01:00
Itamar Haber
29f1a3ee20 Merge remote-tracking branch 'upstream/unstable' into help_subcommands 2017-12-05 18:14:59 +02:00
antirez
11841e212a Streams: add code to compute the stream memory usage.
It's a bit of black magic without actually tracking it inside rax.c,
however Redis usage of the radix tree for the stream data structure is
quite consistent, so a few magic constants apparently are producing
results that make sense.
2017-12-01 12:50:27 +01:00
antirez
8016093ee9 Streams: implement stream object release. 2017-12-01 10:24:24 +01:00
antirez
1850ff43f4 Streams: 12 commits squashed into the initial Streams implementation. 2017-12-01 10:24:24 +01:00
Itamar Haber
50ce8124a3 Standardizes the 'help' subcommand
This adds a new `addReplyHelp` helper that's used by commands
when returning a help text. The following commands have been
touched: DEBUG, OBJECT, COMMAND, PUBSUB, SCRIPT and SLOWLOG.

WIP

Fix entry command table entry for OBJECT for HELP option.

After #4472 the command may have just 2 arguments.

Improve OBJECT HELP descriptions.

See #4472.

WIP 2

WIP 3
2017-11-28 21:15:45 +02:00
zhaozhao.zz
22950a6284 LFU: do some changes about LFU to find hotkeys
Firstly, use access time to replace the decreas time of LFU.
For function LFUDecrAndReturn,
it should only try to get decremented counter,
not update LFU fields, we will update it in an explicit way.
And we will times halve the counter according to the times of
elapsed time than server.lfu_decay_time.
Everytime a key is accessed, we should update the LFU
including update access time, and increment the counter after
call function LFUDecrAndReturn.
If a key is overwritten, the LFU should be also updated.
Then we can use `OBJECT freq` command to get a key's frequence,
and LFUDecrAndReturn should be called in `OBJECT freq` command
in case of the key has not been accessed for a long time,
because we update the access time only when the key is read or
overwritten.
2017-11-27 18:39:22 +01:00
antirez
02aafda9af Improve OBJECT HELP descriptions.
See #4472.
2017-11-27 18:09:08 +01:00
Salvatore Sanfilippo
05c596e1a3 Merge pull request #4472 from itamarhaber/object_patch
A minor fix and `help` subcommand for `OBJECT`
2017-11-27 12:41:02 +01:00
Itamar Haber
fc5c3bdd1b Adds OBJECT help 2017-11-24 19:59:05 +02:00
Itamar Haber
b9329a2959 Prevents OBJECT freq with noeviction
When maxmemory is set to noeviction, idletime is implicitly kept. This renders access frequency nonsensical.
2017-11-24 19:58:37 +02:00
Oran Agra
43a17cc78d fix string to double conversion, stopped parsing on \0 even if the string has more data.
getLongLongFromObject calls string2ll which has this line:
/* Return if not all bytes were used. */
so if you pass an sds with 3 characters "1\01" it will fail.

but getLongDoubleFromObject calls strtold, and considers it ok if eptr[0]==`\0`
i.e. if the end of the string found by strtold ends with null terminator

127.0.0.1:6379> set a 1
OK
127.0.0.1:6379> setrange a 2 2
(integer) 3
127.0.0.1:6379> get a
"1\x002"
127.0.0.1:6379> incrbyfloat a 2
"3"
127.0.0.1:6379> get a
"3"
2017-11-23 17:15:27 +02:00
Itamar Haber
fed5b3b1d0 Fixes an off-by-one in argument handling of MEMORY USAGE
Fixes #4430
2017-11-08 16:08:29 +02:00
antirez
a259494736 More robust object -> double conversion.
Certain checks were useless, at the same time certain malformed inputs
were accepted without problems (emtpy strings parsed as zero).
Cases where strtod() returns ERANGE but we still want to parse the input
where ok in getDoubleFromObject() but not in the long variant.

As a side effect of these fixes, this commit fixes #4391.
2017-10-30 13:39:58 +01:00
antirez
dcd0474384 Add MEMORY DOCTOR to MEMORY HELP. 2017-07-28 17:47:54 +02:00