Open xesina opened 9 years ago
What do you mean of "stop the project"? stop pyspider or via webui? What's the version of phantomjs you are using?
stop the project from web ui. phantomjs --version 1.9.8
Stop projects would not make phantomjs release memory. I have did things to release resources after request finished. But there is no certain way to make sure it did (google "phantomjs memory").
I have a phantomjs instance with crawl rate of 5 pages per minute, it cost ~500MB. And my solution is restart it every hour.
how can i restart phantom? thanks, I will check phantomjs_fetcher.js.
if you are running pyspider use command pyspider
: ps && kill
As you said in js file, there is a memory leak that resolved by : page.settings.loadImages = true;
Does that work? I does not believe that a normal function can lead to memory leak and not fixed!
Yes, after changing that parameter its just working fine!
I will make it true by default.
but load Images take too much time
@binux what's the proper posture to restart PhantomJS every hour?
I run it by: nohup pyspider -c /usr/local/etc/pyspider.json phantomjs &
manage instance with some sort of Process Control System like supervisord.org, then just kill it every hour.
I'm using a vps with 2G of ram with one project in pyspider, after a few minutes of crawling phantoms is filling the memory and won't release even after stopping the project.