hash-max-zipmap-entries

132 views
Skip to first unread message

AcidZombie24

unread,
Oct 8, 2012, 11:35:41 AM10/8/12
to redi...@googlegroups.com
In the config file I have this line

hash-max-zipmap-entries 512

I did the below 1 million times. Memory was 14MB. I changed the value to 513 and the memory became 100MB ouch.
I changed hash-max-zipmap-entries 512 to 10K and tried it again. Still 100MB and 512 gives me 14MB still. Am i modifying the wrong line?
I'm running 64bits and under windows. But I **extremely** doubt the windows port is ignoring the config and hardcoded that in. Can anyone else explain?

var task = conn.Hashes.Set(1, string.Format("k{0}", i / 512), (i%512).ToString(), buf);

PS: buf is a 8byte array

AcidZombie24

unread,
Oct 8, 2012, 11:36:23 AM10/8/12
to redi...@googlegroups.com
I'm using v2.4.5

Felix Gallo

unread,
Oct 8, 2012, 11:43:30 AM10/8/12
to redi...@googlegroups.com
Windows isn't a supported platform; you may wish to contact the people
at Microsoft who attempted the port.

On Mon, Oct 8, 2012 at 8:36 AM, AcidZombie24 <acidzo...@gmail.com> wrote:
> I'm using v2.4.5
>
> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/redis-db/-/W9ZHeAoMoAUJ.
>
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to
> redis-db+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/redis-db?hl=en.

Salvatore Sanfilippo

unread,
Oct 8, 2012, 11:56:31 AM10/8/12
to redi...@googlegroups.com
On Mon, Oct 8, 2012 at 5:43 PM, Felix Gallo <felix...@gmail.com> wrote:
> Windows isn't a supported platform; you may wish to contact the people
> at Microsoft who attempted the port.

That's true but this sounds like something arch independent...

:-) Worth checking. Do you have your dump at hand to share if there
are no private info? To share even with just me and Pieter is ok, no
need to post it in the ML or alike.

Cheers,
Salvatore

> On Mon, Oct 8, 2012 at 8:36 AM, AcidZombie24 <acidzo...@gmail.com> wrote:
>> I'm using v2.4.5
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Redis DB" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/redis-db/-/W9ZHeAoMoAUJ.
>>
>> To post to this group, send email to redi...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> redis-db+u...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/redis-db?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
>



--
Salvatore 'antirez' Sanfilippo
open source developer - VMware
http://invece.org

Beauty is more important in computing than anywhere else in technology
because software is so complicated. Beauty is the ultimate defence
against complexity.
— David Gelernter

AcidZombie24

unread,
Oct 8, 2012, 1:02:02 PM10/8/12
to redi...@googlegroups.com
Ah ha sure no problem. Info again is on windows (7) version 2.4.5, it happened with both 32 and 64bits.

Attached is the dump. Here is the code i used to generate it. If you on linux with mono (or on  windows) simply use booksleeve (its on nuget) as the redis connector
Yes the buffer is an empty 8 byte array. The wait line is because I had some timeout issues with the connection (it limits to 10seconds) so I added that as a quick lazy fix.

How to recreate this in any language should be straight forward I'd rewrite it in python or ruby in 45seconds if i actually knew the language.

        static void memorytest()
        {
            using (var conn = new RedisConnection("localhost", allowAdmin: true))
            {
                conn.Open();
                conn.Server.FlushAll();
                //var buf = new byte[1024/2];
                var buf = new byte[8];
                var amount = 513;
                for (int i = 0; i < 1000000; ++i)
                {
                    //conn.Strings.Set(1, string.Format("k{0}", i), i.ToString());
                    //ignore this conn.Hashes.Set(1, string.Format("k{0}", i/1000), string.Format("{0}",i%1023), buf);
                    var t = conn.Hashes.Set(1, string.Format("k{0}", i / amount), (i % amount).ToString(), buf);
                    if ((i & 1023) == 1023)
                        conn.Wait(t);
                }
                conn.Wait(conn.Strings.Set(1,"hi", buf));
dump.zip

Sripathi Krishnan

unread,
Oct 8, 2012, 11:34:54 PM10/8/12
to redi...@googlegroups.com
See attached memory.csv generated from your dump file. All keys are using a hashtable, so 100MB memory is expected.

Can you try setting hash-max-ziplist-entries as well? zipmap was deprecated sometime back and the setting was renamed to ziplist. I suspect redis is picking up the default value of 512 because you are setting the wrong key.


--Sri


To view this discussion on the web visit https://groups.google.com/d/msg/redis-db/-/8Zi85lcAzuwJ.
memory.csv

AcidZombie24

unread,
Oct 9, 2012, 8:35:12 AM10/9/12
to redi...@googlegroups.com
Sure, I still got 100mb.

Damn I figured it out! Its one of those obvious problems.

I didnt include the conf file in the command line :x. I just assumed it reads it if its in its directory (that is traditionally how app work right??)
I got the hint when I couldnt find where in linux the conf file is located (I didnt see in ./src or /etc/). After I googled...

Case close I knew it was some stupid error on my part.
I'd like to request redis look at default locations (/etc/ and ./ in case its bundled) and scream if none is added requiring to the arg -no-config

Dhirendra Rawal

unread,
Jan 15, 2018, 8:16:44 AM1/15/18
to Redis DB
I am doing similar to this but my redis server not start when i set hash-max-zipmap-entries  and hash-max-zipmap-value parameter. i am using redis 4.0.2.
Any special settings need to do for this ?

Itamar Haber

unread,
Jan 15, 2018, 9:05:35 AM1/15/18
to Redis DB
What exactly are you doing and what errors are you seeing?

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.

To post to this group, send email to redi...@googlegroups.com.

hva...@gmail.com

unread,
Jan 15, 2018, 10:44:23 AM1/15/18
to Redis DB
You're replying to a thread from 2012.  The names of these two Redis parameters were changed in 2013 and are now named:
  • hash-max-ziplist-entries
  • hash-max-ziplist-value
The Redis code comes with a well-commented example config file that has the correct names for these parameters. Is your Redis refusing to start because you put the old parameter names into your config file?
Reply all
Reply to author
Forward
0 new messages