javascript - Multiple PhantomJS instances hanging -


i having problem when running multiple instances of phantomjs on ubuntu 14. after few minutes, processes become unresponsive.

brief background: using phantomjs 2.0 render web page gets saved pdf using wkhtmtopdf. phantomjs responsible loading page, making ajax requests, , waiting response after pdf saved on server. not generate pdf itself. there hundreds of web pages need generated pdf, want run many phantomjs instances in parallel system allows.

each phantomjs process started shell script so: {path phantomjs} {path js file} --data {some argument} >> {path log file} 2>&1 &

the problem occurs after couple of minutes stop getting output phantomjs processes, , looking @ top can see laying there not doing anything. js script has timers retry load page if takes longer minute, , call phantom.exit() if page can't load / pdf generation fails. if goes wrong, process should still exit - doesn't.

i tried changing number of phantomjs instances running in parallel. tried 20 -> 10 -> 5 -> 3, doesn't seem matter. can many more jobs execute when maintaining 20 instances @ time.

when running --debug=true can see @ point gets stuck @ [debug] webpage - updateloadingprogress: going through output see several of these warnings: [warning] qiodevice::write: device not open makes me believe source of problem.

i thought there might contention file resources tried without redirecting output log file, , not using --local-storage-path, didn't help.

as side note, have been using phantomjs several years doing same procedure, sequentially (run single phantomjs process @ time). , although there few snags overcome, worked great.

any idea what's causing this? faced similar problem? advice on running multiple phantomjs instances in parallel?

thanks!

i faced exact same issue both locally , on ci server (which ubuntu). uninstalling 2.0.0 , upgrading to 2.1.1 resolved problem me.


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -