- 08 May, 2014 1 commit
-
-
antirez authored
-
- 28 Apr, 2014 1 commit
-
-
antirez authored
This commit adds peer ID caching in the client structure plus an API change and the use of sdsMakeRoomFor() in order to improve the reallocation pattern to generate the CLIENT LIST output. Both the changes account for a very significant speedup.
-
- 20 Mar, 2014 1 commit
-
-
antirez authored
-
- 10 Mar, 2014 3 commits
-
-
antirez authored
The new "error" subcommand of the DEBUG command can reply with an user selected error, specified as its sole argument: DEBUG ERROR "LOADING please wait..." The error is generated just prefixing the command argument with a "-" character, and replacing newlines with spaces (since error replies can't include newlines). The goal of the command is to help in Client libraries unit tests by making simple to simulate a command call triggering a given error.
-
antirez authored
getKeysFromCommand() is designed to be called with the command arguments passing the basic arity checks described in the command table. DEBUG CMDKEYS must provide the same guarantees for calling getKeysFromCommand() to be safe.
-
antirez authored
Examples: redis 127.0.0.1:6379> debug cmdkeys set foo bar 1) "foo" redis 127.0.0.1:6379> debug cmdkeys mget a b c 1) "a" 2) "b" 3) "c" redis 127.0.0.1:6379> debug cmdkeys zunionstore foo 2 a b 1) "a" 2) "b" 3) "foo" redis 127.0.0.1:6379> debug cmdkeys ping (empty list or set)
-
- 10 Dec, 2013 1 commit
-
-
antirez authored
Redis hash table implementation has many non-blocking features like incremental rehashing, however while deleting a large hash table there was no way to have a callback called to do some incremental work. This commit adds this support, as an optiona callback argument to dictEmpty() that is currently called at a fixed interval (one time every 65k deletions).
-
- 27 Aug, 2013 1 commit
-
-
antirez authored
This command is only useful for low-level debugging of memory issues due to sds wasting memory as empty buffer at the end of the string.
-
- 22 Jul, 2013 1 commit
-
-
antirez authored
Previously two string encodings were used for string objects: 1) REDIS_ENCODING_RAW: a string object with obj->ptr pointing to an sds stirng. 2) REDIS_ENCODING_INT: a string object where the obj->ptr void pointer is casted to a long. This commit introduces a experimental new encoding called REDIS_ENCODING_EMBSTR that implements an object represented by an sds string that is not modifiable but allocated in the same memory chunk as the robj structure itself. The chunk looks like the following: +--------------+-----------+------------+--------+----+ | robj data... | robj->ptr | sds header | string | \0 | +--------------+-----+-----+------------+--------+----+ | ^ +-----------------------+ The robj->ptr points to the contiguous sds string data, so the object can be manipulated with the same functions used to manipulate plan string objects, however we need just on malloc and one free in order to allocate or release this kind of objects. Moreover it has better cache locality. This new allocation strategy should benefit both the memory usage and the performances. A performance gain between 60 and 70% was observed during micro-benchmarks, however there is more work to do to evaluate the performance impact and the memory usage behavior.
-
- 19 Jun, 2013 1 commit
-
-
antirez authored
When the semantics changed from logfile = NULL to logfile = "" to log into standard output, no proper change was made to logStackTrace() to make it able to work with the new setup. This commit fixes the issue.
-
- 04 Jun, 2013 1 commit
-
-
antirez authored
-
- 17 May, 2013 1 commit
-
-
YAMAMOTO Takashi authored
SUSv3 says that: The useconds argument shall be less than one million. If the value of useconds is 0, then the call has no effect. and actually NetBSD's implementation rejects such a value with EINVAL. use nanosleep which has no such a limitation instead.
-
- 28 Mar, 2013 1 commit
-
-
antirez authored
-
- 27 Mar, 2013 1 commit
-
-
antirez authored
We need the ability to disable the activeExpireCycle() (active expired key collection) call for testing purposes.
-
- 27 Feb, 2013 1 commit
-
-
antirez authored
This commit also fixes redisLog() statements producing warnings.
-
- 13 Feb, 2013 1 commit
-
-
antirez authored
-
- 19 Jan, 2013 1 commit
-
-
guiquanz authored
-
- 09 Jan, 2013 1 commit
-
-
Bilal Husain authored
fixed typo in a comment (step 2 memcheck)
-
- 14 Dec, 2012 1 commit
-
-
antirez authored
REDIS_HZ is the frequency our serverCron() function is called with. A more frequent call to this function results into less latency when the server is trying to handle very expansive background operations like mass expires of a lot of keys at the same time. Redis 2.4 used to have an HZ of 10. This was good enough with almost every setup, but the incremental key expiration algorithm was working a bit better under *extreme* pressure when HZ was set to 100 for Redis 2.6. However for most users a latency spike of 30 milliseconds when million of keys are expiring at the same time is acceptable, on the other hand a default HZ of 100 in Redis 2.6 was causing idle instances to use some CPU time compared to Redis 2.4. The CPU usage was in the order of 0.3% for an idle instance, however this is a shame as more energy is consumed by the server, if not important resources. This commit introduces HZ as a runtime parameter, that can be queried by INFO or CONFIG GET, and can be modified with CONFIG SET. At the same time the default frequency is set back to 10. In this way we default to a sane value of 10, but allows users to easily switch to values up to 500 for near real-time applications if needed and if they are willing to pay this small CPU usage penalty.
-
- 29 Nov, 2012 2 commits
-
-
antirez authored
The idea is to be able to identify a build in a unique way, so for instance after a bug report we can recognize that the build is the one of a popular Linux distribution and perform the debugging in the same environment.
-
antirez authored
1) We no longer test location by location, otherwise the CPU write cache completely makes our business useless. 2) We still need a memory test that operates in steps from the first to the last location in order to never hit the cache, but that is still able to retain the memory content. This was tested using a Linux box containing a bad memory module with a zingle bit error (always zero). So the final solution does has an error propagation step that is: 1) Invert bits at every location. 2) Swap adiacent locations. 3) Swap adiacent locations again. 4) Invert bits at every location. 5) Swap adiacent locations. 6) Swap adiacent locations again. Before and after these steps, and after step 4, a CRC64 checksum is computed. If the three CRC64 checksums don't match, a memory error was detected.
-
- 28 Nov, 2012 1 commit
-
-
Matt Arsenault authored
-
- 22 Nov, 2012 2 commits
-
-
charsyam authored
-
antirez authored
We use this new bio.c feature in order to stop our I/O threads if there is a memory test to do on crash. In this case we don't want anything else than the main thread to run, otherwise the other threads may mess with the heap and the memory test will report a false positive.
-
- 21 Nov, 2012 1 commit
-
-
antirez authored
-
- 08 Nov, 2012 1 commit
-
-
antirez authored
-
- 24 Aug, 2012 1 commit
-
-
antirez authored
The previous implementation of zmalloc.c was not able to handle out of memory in an application-specific way. It just logged an error on standard error, and aborted. The result was that in the case of an actual out of memory in Redis where malloc returned NULL (In Linux this actually happens under specific overcommit policy settings and/or with no or little swap configured) the error was not properly logged in the Redis log. This commit fixes this problem, fixing issue #509. Now the out of memory is properly reported in the Redis log and a stack trace is generated. The approach used is to provide a configurable out of memory handler to zmalloc (otherwise the default one logging the event on the standard output is used).
-
- 11 Jun, 2012 1 commit
-
-
antirez authored
The ziplist -> hashtable conversion code is triggered every time an hash value must be promoted to a full hash table because the number or size of elements reached the threshold. If a problem in the ziplist causes the same field to be present multiple times, the assertion of successful addition of the element inside the hash table will fail, crashing server with a failed assertion, but providing little information about the problem. This code adds a new logging function to perform the hex dump of binary data, and makes sure that the ziplist -> hashtable conversion code uses this new logging facility to dump the content of the ziplist when the assertion fails. This change was originally made in order to investigate issue #547.
-
- 13 May, 2012 1 commit
-
-
antirez authored
A previous commit introduced REDIS_HZ define that changes the frequency of calls to the serverCron() Redis function. This commit improves different related things: 1) Software watchdog: now the minimal period can be set according to REDIS_HZ. The minimal period is two times the timer period, that is: (1000/REDIS_HZ)*2 milliseconds 2) The incremental rehashing is now performed in the expires dictionary as well. 3) The activeExpireCycle() function was improved in different ways: - Now it checks if it already used too much time using microseconds instead of milliseconds for better precision. - The time limit is now calculated correctly, in the previous version the division was performed before of the multiplication resulting in a timelimit of 0 if HZ was big enough. - Databases with less than 1% of buckets fill in the hash table are skipped, because getting random keys is too expensive in this condition. 4) tryResizeHashTables() is now called at every timer call, we need to match the number of calls we do to the expired keys colleciton cycle. 5) REDIS_HZ was raised to 100.
-
- 26 Apr, 2012 1 commit
-
-
antirez authored
-
- 24 Apr, 2012 1 commit
-
-
antirez authored
This fixes compilation on FreeBSD (and possibly other systems) by not using ucontext_t at all if HAVE_BACKTRACE is not defined. Also the ifdefs to get the registers are modified to explicitly test for the operating system in the first level, and the arch in the second level of nesting.
-
- 02 Apr, 2012 1 commit
-
-
Premysl Hruby authored
-
- 28 Mar, 2012 1 commit
-
-
antirez authored
-
- 27 Mar, 2012 4 commits
-
-
antirez authored
Produce the watchlog warning log in a way that is safer from a signal handler. Fix a memory leak in the backtrace generation function.
-
antirez authored
-
antirez authored
-
antirez authored
SIGSEGV handler refactored so that we can reuse stack trace and current client logging functionalities in other contexts.
-
- 18 Mar, 2012 1 commit
-
-
antirez authored
-
- 21 Feb, 2012 1 commit
-
-
Pieter Noordhuis authored
-
- 08 Feb, 2012 1 commit
-
-
antirez authored
-