Hey there!
I'm using web2py in production to serve websites. I have two Redis
instances: one for cache and one for sessions. Each Redis instance runs in
a VPS with 24gb of RAM. A few days ago suddently the Redis instance
rejected all write attempts, this is the traceback:
Traceback (most recent call last):
File "/var/www/medios/gluon/main.py", line 462, in wsgibase
session._try_store_in_db(request, response)
File "/var/www/medios/gluon/globals.py", line 1226, in _try_store_in_db
record_id = table.insert(**dd)
File "/var/www/medios/gluon/contrib/redis_session.py", line 138, in insert
newid = str(self.db.r_server.incr(self.serial))
File
"/var/www/medios/venv_medios/lib/python2.7/site-packages/redis/client.py",
line 651, in incr
return self.execute_command('INCRBY', name, amount)
File
"/var/www/medios/venv_medios/lib/python2.7/site-packages/redis/client.py",
line 394, in execute_command
return self.parse_response(connection, command_name, **options)
File
"/var/www/medios/venv_medios/lib/python2.7/site-packages/redis/client.py",
line 404, in parse_response
response = connection.read_response()
File
"/var/www/medios/venv_medios/lib/python2.7/site-packages/redis/connection.py",
line 316, in read_response
raise response
ResponseError: OOM command not allowed when used memory > 'maxmemory'.
But it doesn't make sense, as the server has plenty of RAM available,
checked with command "free -m":
total: 23940
used: 1617
free: 21784
shared: 96
buff/cache: 538
available: 22018
Also, Redis memory usage is at normal levels, checked with command
"redis-cli info memory":
used_memory_human:1.26G
used_memory_rss_human:1.33G
total_system_memory_human:23.38G
maxmemory_human:20.00G
maxmemory_policy:allkeys-lru
allocator_frag_ratio:1.03
mem_fragmentation_ratio:1.05
I don't use sessions for anything out of the ordinary. Most of the requests
don't modify the session and execute session.forget(response). I only use
sessions to handle a few logged in users. This is how my app connects to
session in models/db.py:
sessiondb = RedisSession(
session_expiry=172800, # two days
redis_conn=RConn(
host=REDIS_SESSION_HOST,
port=REDIS_SESSION_PORT,
password=REDIS_SESSION_PASSWORD,
application=request.application))
session.connect(request, response, db=sessiondb)
I'm using this web2py version:
Version 2.17.1-stable+timestamp.2018.08.06.01.02.56
I know it's old but it's been running so smoothly :) serving ~60 rps.
I use virtualenv and this is what I see when I run 'pip freeze | grep
"redis"':
redis==2.8.0
What could be the reason of the issue?
Thanks in advance!
Warm regards,
Lisandro.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/60520256-5efd-49da-8396-e5278e193adfn%40googlegroups.com.