Code Monkey home page Code Monkey logo

Comments (5)

fengmk2 avatar fengmk2 commented on August 24, 2024

目前是在worker死了1.5倍心跳时间后,会被正在杀掉,在这期间不会接受新的请求,但是仍然会处理就的请求。

from pm.

fengmk2 avatar fengmk2 commented on August 24, 2024

worker心跳 heartbeat_interval 默认是 2000ms.

from pm.

fengmk2 avatar fengmk2 commented on August 24, 2024

你的worker代码的setTimeout是6秒后才end的。

from pm.

leizongmin avatar leizongmin commented on August 24, 2024

我的意思是,worker进程没有死掉,而是更新了代码后,主动reload相应的worker进程,但是杀死旧的worker进程时,必须让其处理完旧的请求,同时能启动新的worker进程来接收新的请求。

from pm.

aleafs avatar aleafs commented on August 24, 2024

@leizongmin 严谨地判断一个进程是不是在业务上“空闲”了pm是做不到的,所以pm在每个worker中留了一个简单粗暴的接口,允许开发者指定退出延迟。你可以通过指定 terminate_timeout 来改变这个延迟时间,默认1s:

https://github.com/aleafs/pm/blob/master/lib/worker.js#L84

from pm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.