Redis blocked by slow query, cannot use SLOWLOG

457 views
Skip to first unread message

Lukas Rieder

unread,
Jan 9, 2014, 8:46:40 AM1/9/14
to redi...@googlegroups.com
Hi,

first of all sorry if this post shows up twice. I used the Google Web interface and my post didn’t show up, so I decided to write one with my E-Mail client.

Today I was working on a live issue that involved an unresponsive Redis instance.
I went on the server and connected with Redis in order to investigate what query is blocking the process.
But using SLOWLOG Redis I only got "BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE”
So the database was continued to be hit with those slow queries, since this was all live.

Eventually I could get a hold of the content of the slowlog by executing SCRIPT KILL and SLOWLOG GET 1 in quick succession.

I am posting this here, because I think it would be helpful to have SLOWLOG logged to somewhere else. I searched around for such a solution but I couldn’t find anything.


Cheers,

Lukas Rieder | Backend Developer

www.wooga.com  wooga GmbH | Saarbruecker Str. 38 | D-10405 Berlin Sitz der Gesellschaft: Berlin; HRB 117846 B Registergericht Berlin-Charlottenburg Geschaeftsfuehrung: Jens Begemann, Philipp Moeser

alex

unread,
Jan 11, 2014, 3:06:25 AM1/11/14
to redi...@googlegroups.com

For this reasons when a script executes for more than the specified time the following happens:

  • Redis logs that a script is running too long.
  • It starts accepting commands again from other clients, but will reply with a BUSY error to all the clients sending normal commands. The only allowed commands in this status are SCRIPT KILL and SHUTDOWN NOSAVE.
  • It is possible to terminate a script that executes only read-only commands using the SCRIPT KILL command. This does not violate the scripting semantic as no data was yet written to the dataset by the script.
  • If the script already called write commands the only allowed command becomes SHUTDOWN NOSAVE that stops the server without saving the current data set on disk (basically the server is aborted).
Reply all
Reply to author
Forward
0 new messages