I have been using phantomjs for doing some heavy lifting for me in a server side dom environment. Till now I have been putting by data structures in-memory (i.e. doing nothing special with them) and everything was fine. But recently under some use cases i started running into following problems:
- memory usage becoming too high making swap to kick in and seriously effecting my performance.
- not being able to resume from the last save point since in-memory data structures are not persistent (obviously)
This forced me to look for a database solution to be used on phantom but again I am running into issues while deciding on a solution:
- I don't want my performance to get too effected.
- it has to be persistent and queryable
- how do i even connect to a database from inside phantom script.
Can anyone guide me to a satisfactory solution?
Note: I have almost decided on sqlite but connecting to it from phantom is still an issue. Nodejs provides sqlite3 node module, i am trying to browserify it for phantom but how do i retaing my connection across pages in phantom?
Thanx in advance!
Aucun commentaire:
Enregistrer un commentaire