fzaninotto / screenshot-as-a-service

Website screenshot service powered by node.js and phantomjs
1.1k stars 243 forks source link

Heroku compatibility #17

Closed curious-attempt-bunny closed 12 years ago

curious-attempt-bunny commented 12 years ago

Hey there,

It's been great using screenshot.etf1.fr, but it's now offline. I tried running this app on heroku and ran into perhaps four issues:

  1. Exceeding the memory limitation (perhaps the process can be configured to use less): heroku[web.1]: Process running mem=531M(103.8%) heroku[web.1]: Error R14 (Memory quota exceeded)
  2. It looks like the app uses the file system and AFAIK that's not allowed with Heroku.
  3. The heroku log shows repeated failing attempts to use execvp: app[web.1]: phantomjs error: execvp(): No such file or directory
  4. It's not legal to use extra ports, whcih phantomjs appears to be using: app[web.1]: Phantomjs internal server listening on port 3001

Are these surmountable problems do you think?

Cheers, Merlyn

fzaninotto commented 12 years ago

Nope.

The main culprit is the phantomjs process, which can only communicate with the node.js process using http (on a custom port) and the filesystem (for images). The filesystem is also required for the caching feature. There is an alternative: reimplementing Node.js inside the phantomjs process (that's what phantomjs-node does and it's not pretty). This won't be used in Screenshot-as-a-service.

You should report problems 1 and 3 on the phantomjs issue tracker.

Otherwise, try another cloud provider - a IaaS rather than a PaaS.