Windows. Possible to use one instance of PhantomJS, for launching one script in many times?

174 views
Skip to first unread message

Alexandr Mikhnevich

unread,
Feb 18, 2014, 2:25:16 AM2/18/14
to phan...@googlegroups.com
Greetings!

Platform: Windows (8.1)
Version: Official 1.9 from site.

I wrote some script. 1st argument - addres of web-site, other arguments - options for receiving info from this site.

I have alot of web-sites, for each user set some settings(settings is a script arguments), for each site I call phantomJS with my script & arguments definded for this site. As call phantomJS, I mean that;
1. Create process with arguments
2. Wait until process destroyed, and return exit code for site N
n... repeat thet again for site N in cycle.

In each start & each end, I got some PC resources jumps, in start app allocate many resources, in exit it return resources to system. I searching some soulion to resolve that resource usage problem...

Possible to use PhantomJS in that mode:
1. Launch one instance of PhantomJS
2. for each site call script, send some command to app StdInput with it, if in StdOutput(if avaliable) prev script return good return
3. Close instance of PhantomJS

?

Anybody knows some ideas, solutions, sugestions?

Thanks.

Jason Swearingen

unread,
Feb 18, 2014, 10:31:21 PM2/18/14
to phan...@googlegroups.com
You can recycle the phantomJs instance.   however there are issues with this approach, most notiablly memory leaks in the pjs process.  See here for more details: http://stackoverflow.com/questions/9961254/how-to-manage-a-pool-of-phantomjs-instances/19627219#19627219

Alexandr Mikhnevich

unread,
Feb 20, 2014, 2:16:49 AM2/20/14
to phan...@googlegroups.com
Problem resolved, I create pool PhantomJS of processes.
Reply all
Reply to author
Forward
0 new messages