PHP FPM shutdown behavior

  1. we restart php-fpm while the script is still executing
  2. nginx terminates the connection because of fastcgi_timeout
  3. you send sigkill to fpm worker processes using kill command
  4. a fatal error occurs
  5. php runs out of allocated memory.
  6. max_execution_time is exceeded. (Is max_execution_time wall time or time spent executing processes AKA virtual time.)
strace output
strace output when kill command is used
public function connect(){
throw new \Exception('Something went wrong');
}
public function connect(){
$count = 0;
while($count<1000000){
$this->data[]='abhishek J';
$count++;
}
}
public function connect(){
while(true){
$count = 0;
}
}
public function connect(){
$s = time();
sleep(60);
$e = time();
echo $e-$s;
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store