phantombuster / nickjs

Web scraping library made by the Phantombuster team. Modern, simple & works on all websites. (Deprecated)
https://nickjs.org
ISC License
500 stars 48 forks source link

The number of process for chrome is increasing even I use tab.close() #39

Open msaus opened 6 years ago

msaus commented 6 years ago

Environemnt: Ubuntu 16.04 Nickjs ^0.3.6 Nodejs v8.11.1

Hello there, I am getting this even I use the tab.close(). Do you know why I am getting more chrome process? Should I use nick.exit() after the execution if I want to kill all chrome process?

Regards,

msaus commented 6 years ago

But, if I use nick.exit() then pm2 process restarts every time.......

msaus commented 6 years ago

Well....possibly this could solve like following with pm2.

  1. Set pm2 exec_mode to cluster.
  2. Set pm2 instance to 4.
  3. Set concurrent request to 2(guzzelHttp Client).
  4. Use tab.close() and nick.exit() after execution.

The point is that the number of concurrent request should be 2 time bigger than pm2 instance.

paps commented 6 years ago

It's not clear in my head what you're trying to achieve. Can you describe your use case in more details?

nick.exit() will kill all chrome processes. You can also kill it manually by executing a shell command like killall google-chrome or similar, using Node's child_process module. (In that case, you'll need to delete/lose all references to your current Nick instance, and start another one with new.)

If Chrome really starts a infinite number of processes just by opening tabs over time, then it's a bug with Chrome itself and should be reported upstream. (That is, in Chrome's bug tracker.)

msaus commented 6 years ago

Sorry for unclear explanation. I am getting infinite number of process if I do not use nick.exit(). So, I was trying to kill google chrome process every time finished. chrome version is 67 and i guess this is the latest one for ubuntu. I just reported this to google yesterdays and see what they reply.