SCRIPT KILL

레디스 개발자 교육 신청 레디스 정기점검/기술지원
Redis Technical Support
레디스 엔터프라이즈 서버
Redis Enterprise Server

SCRIPT KILL

실행중인 Lua Script를 중지(kill) 시킬 수 있는 조건은 다음과 같습니다.

  1. lua-time-limit를 초과해야 합니다. 디폴트 5초.
    그전에는 어떠한 명령으로도 죽일 수 없습니다. 왜냐하면 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 명령으로 실행중인 스크립트를 죽일 수 있습니다. SCRIPT KILL 명령이 실행되면 redis.log에 아래와 같은 로그가 남습니다.
    Lua script killed by user with SCRIPT KILL.
  3. lua-time-limit가 지났고, Script내에서 write 명령을 실행했다면 SHUTDOWN NOSAVE 명령으로 레디스 서버를 죽여야 합니다. 다른 방법은 없습니다.
  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 실행중에는 레디스 서버가 매초마다 lua-time-limit가 지났는지 확인합니다.

Example

명령>SCRIPT KILL
결과>OK
(2.65s)

명령문

SCRIPT FLUSH

  • 이 명령은 version 2.6.0 부터 사용할 수 있다.
  • O(1)

<< SCRIPT FLUSH SCRIPT KILL SCRIPT DEBUG >>

Email 답글이 올라오면 이메일로 알려드리겠습니다.

혹시 처음이세요?
레디스게이트에는 레디스에 대한 많은 정보가 있습니다.
레디스 소개, 명령어, SQL, 클라이언트, 서버, 센티널, 클러스터 등이 있습니다.
혹시 필요한 정보를 찾기 어려우시면 redisgate@gmail.com로 메일 주세요.
제가 찾아서 알려드리겠습니다.
 
close
IP를 기반으로 보여집니다.