Closed bertho-zero closed 8 years ago
Hi @bertho-zero ,
I had applied your solution but I got an error "Assertion failed: ((consumed_) == (false)), function Consume, file ../src/stream_base.h, line 203." Then workers went die.
Did you get the same issue?
@haduythuan people have similar issues here, might want to subscribe for a fix: https://github.com/nodejs/node/issues/3072
This fix worked for me, thanks!
@bertho-zero hii friend, nice work but u must add count of cpu - 1 in sticky options cause in this way it is running extra cluster, cause as u run gulp it runs mean.serve that runs sticky all cpu cores so it is result with x cores + 1 so easy way to fix this i suggest to use sticky options
in ExpressEngine.js
let cpuCount = require('os').cpus().length,
stickyOptions = {
num: cpuCount - 1
};
and replace both lines of sticky with
sticky(stickyOptions, http*
but this is type of cosmetic fix for this problem cause here are 1master cluster + cpu.count - 1 i will look for real solution
ps u can even notice that while stating up with production u see extra cluster worker id
@bertho-zero are you able to integrate these changes from @emps? If not I will re-roll this PR as it was essentially to get our app working in production on heroku
To take advantage of our already used CPU_COUNT env var, I'd do:
let cpuCount = process.env.CPU_COUNT || require('os').cpus().length,
stickyOptions = {
num: cpuCount - 1
};
Thanks @bertho-zero and @emps this has landed in 0.6.X / master
For activate socket.io compatibility in production mode, or with multiple clusters, set
clusterSticky
totrue
in your config file.