Skip to content
This repository was archived by the owner on Mar 30, 2022. It is now read-only.
This repository was archived by the owner on Mar 30, 2022. It is now read-only.

How to determine worker termination cause? #31

@diversario

Description

@diversario

I create workers with this bit of code:

for (var i = 0; i < MAX_WORKERS; i++){
  arr[i] = new Worker(CURRENT_DIR + '/lib/workers/worker.js');

  arr[i].onmessage = function(msg, cb) { ... }
  }

  arr[i].onexit = function(code, syssignal){
    console.log("\033[1;32m#### WORKER TERMINATED, signal %s #####\033[0m", syssignal);
  };

}

My intention is to use long-lived workers and rotate through them (I'm using them for file upload handling). Is this the right approach?

Second, these workers terminate with signal null when server is under heavy load (not file uploads, but just GET /). Why would they do that and how can I figure out why they crash?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions