-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CPU Usage to 100% #197
Comments
I think I might have found something that might explain this -- you need to make sure your I just spent some time debugging this issue, and it looks like You need to set a handler for this.pool.on("factoryCreateError", err => {
this.poolErrors.push(err);
// Stop the pool if resource allocation fails too many times
if (this.poolErrors.length > this.maxPoolErrors) {
this.emit("error", new Errors.ResourceAllocationFailureLimitExceeded());
this.disconnect(); // stops the pool and does some other stuff
}
}); |
It seems that others (including myself) have this issue if you search for "infinite" in Issues |
I think it is a good default behavior which can solve this problem. this._pool.on('factoryCreateError', err => {
this._pool._waitingClientsQueue.dequeue().reject(err);
}); |
This doesn't seem safe as there's no guarantee the error came from the first waiting client in the queue. |
In my understanding, _waitingClientsQueue should be a list waiting for new clients which being creating, when an error is thrown in creating, give this error as rejection in any item in this _waitingClientsQueue should be ok to notice that this waiting will not succeed due to this create error. And naturally, pick the first one from the queue to reject will be the common way. |
I am using phantom-pool which interns uses generic-pool.
After running few hundered urls, phantomJs CPU usage shoots up to 100% and instances are not killed. Is anybody else seeing this? I have to manually restart the pool. Is there a better way to fix this?
Is there a way to kill old processes let say after 1 minute which have stopped responding?
My current configuration bellow:
The text was updated successfully, but these errors were encountered: