djveremix / redis

Automatically exported from code.google.com/p/redis
0 stars 0 forks source link

Unable to spawn an I/O thread: Resource temporarily unavailable #241

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Latest redis, with vm-enabled yes
maxmemory 3221225472
appendfsync no
vm-max-memory 2936012800

After all 3Gb of RAM was filled with keys, this error appear.

What is the expected output? What do you see instead?
[32391] 11 May 22:54:47 - DB 0: 72407 keys (0 volatile) in 131072 slots HT.
[32391] 11 May 22:54:47 - 0 clients connected (0 slaves), 2936057012 bytes
in use
[32391] 11 May 22:54:47 # Unable to spawn an I/O thread: Resource
temporarily unavailable
[32391] 11 May 22:54:48 # Unable to spawn an I/O thread: Resource
temporarily unavailable

And after it I can't connect to to running server 

What version of the product are you using? On what operating system?
Latest redis for git, with vm-enabled yes
Linux Gentooo - 2.6.33
Dual Core Dual Xeon,  
compiled with standard flags.

Please provide any additional information below.

Original issue reported on code.google.com by dilido...@gmail.com on 12 May 2010 at 5:33

GoogleCodeExporter commented 9 years ago
Are you running 64-bit OS? Because it looks like you are running 32-bit OS.

Original comment by kmeren...@gmail.com on 12 May 2010 at 5:42

GoogleCodeExporter commented 9 years ago
I run 32bit OS. 
Linux 2.6.33-IS #5 SMP Wed Mar 17 10:58:13 CDT 2010 i686 Intel(R) Xeon(TM) CPU
3.20GHz GenuineIntel GNU/Linux

Original comment by dilido...@gmail.com on 12 May 2010 at 6:48

GoogleCodeExporter commented 9 years ago
32-bit applications cannot use more than 3G of RAM.

Original comment by kmeren...@gmail.com on 12 May 2010 at 6:55

GoogleCodeExporter commented 9 years ago
In this case, I can give 2.99 Gb RAM maximum ?
Can I also use 4 Gb virtual memory ? This limit of 3Gb is only for active RAM I 
hope,
not for virtual memory ? 
Thank you !

Original comment by dilido...@gmail.com on 12 May 2010 at 7:05

GoogleCodeExporter commented 9 years ago
Hello. Redis is not able to obtain a precise measure of memory, so for instance 
when it thinks it is using 3GB 
maybe it is using 4GB, even if this was improved recently it is still not 
perfect. Probably what happens there is 
that the box is really out of memory, you should try lowering the memory limit.

Also note that vm-max-memory is only an hit, as Redis needs to take all the 
keys in memory, so even if you 
set it to 3GB, there is no way Redis is able to guarantee this limit if you set 
too many keys. It can just swap 
values to free the memory.

Ciao,
Salvatore

Original comment by anti...@gmail.com on 12 May 2010 at 7:32

GoogleCodeExporter commented 9 years ago
Thank you very much for the answer.
Ny linux-box have 8Gb of RAM, I always have 4Gb of RAM free, that's why I 
decide to
give 3Gb to Redis.

While this situation happens, I still have 500Mb free of RAM.

The questions is: Is it true, that on 32bit OS, I can't give Redis more than 
3Gb, and
how can I be sure, that it will not take more than 3Gb. If I understand well, 
Redis
must remove all records by Expire, to keep working. It's now good, if it's stop
responding. 
Or may be there is another solution, how to calculate the right value for 
maxmemory
option ?

I read, that if I compile Redis in 64bit, it will use about 70% more memory to 
store
same keys. That's why i prefer to use a 32bit model.

Original comment by dilido...@gmail.com on 12 May 2010 at 7:40

GoogleCodeExporter commented 9 years ago
A bit late but I can answer to this question: yes, on 32bit OS, a process 
cannot have more than 3Gb ram, even with pae enabled: 
http://www.spack.org/wiki/LinuxRamLimits

I have actually the problem and am looking for a solution (probably switch to a 
64b OS).
(OS: Ubuntu 10.4 - Server 32b / Revis version : master / 8Gb Ram)

Original comment by raphael....@gmail.com on 16 Jul 2010 at 12:28

GoogleCodeExporter commented 9 years ago
Raphael: thank you very much for this information!

Cheers,
Salvatore

Original comment by anti...@gmail.com on 30 Aug 2010 at 11:01