SCRIPT KILL

Redis 開発者教育の申込 Redis 定期点検/技術サポート
Redis Technical Support
Redis エンタープライズサーバー
Redis Enterprise Server

SCRIPT KILL

実行中の Lua Script を停止(kill)できる条件は次のとおりです。

  1. lua-time-limit を超える必要があります。デフォルト(default) 5秒。
    それ以前はどのコマンドでも kill できません。 Lua Script も atomicity(アトミック)に実行されるためです。
    lua-time-limit 前に通常コマンドを実行すると次のようなメッセージを受けます。
    (error) BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE.
    lua-time-limit を過ぎると redis.log に次のようなログを残します。
    Lua slow script detected: still in execution after 5001 milliseconds. You can try killing the script using the SCRIPT KILL command.
  2. lua-time-limit が過ぎ、Script 内で write コマンドを実行していなければ SCRIPT KILL コマンドで実行中のスクリプトを kill できます。 SCRIPT KILL コマンドが実行されると redis.log に次のようなログが残ります。
    Lua script killed by user with SCRIPT KILL.
  3. lua-time-limit が過ぎ、Script 内で write コマンドを実行した場合は SHUTDOWN NOSAVE コマンドで Redis サーバーを停止する必要があります。他の方法はありません。
  4. Script 内で書き込みコマンドを実行した状態で SCRIPT KILL を実行すると次のようなメッセージを受けます。
    (error) UNKILLABLE Sorry the script already executed write commands against the dataset. You can either wait the script termination or kill the server in a hard way using the SHUTDOWN NOSAVE command.
  5. Lua Script 実行中、Redis サーバーは毎秒 lua-time-limit が過ぎたかを確認します。

Example

コマンド>SCRIPT KILL
結果>OK
(2.65s)

構文

SCRIPT FLUSH

  • このコマンドは version 2.6.0 から使用できます。
  • O(1)

<< SCRIPT FLUSH SCRIPT KILL SCRIPT DEBUG >>

Email 返事がかかってなれば、メールでお知らせします。