The thumbnails are generated using phantomjs server. I'm using https://github.com/blockai/phantom-pool to make sure the phantomjs instance is reused.
Also I'm using a scheduling node package (https://github.com/Automattic/kue) to make sure that images are precached as the link are submited to hackernews.