alvarcarto / url-to-pdf-api

Web page PDF/PNG rendering done right. Self-hosted service for rendering receipts, invoices, or any content.
MIT License
7.03k stars 779 forks source link

Improve performance #107

Closed annirak closed 4 years ago

annirak commented 5 years ago

Hi, thanks for this project, We are using it quite heavy and want to know if you have any ideas how to improve the speed? Its taking an avg of 16 sec and some cases up to 57 secs.

Thanks!

kimmobrunfeldt commented 5 years ago

Are you using a large enough server with enough RAM installed? In my tests that has been a big factor in speed.

massimoliani commented 5 years ago

I'm using a free heroku account (during developing) to avoid the sleeping of dyno I'm posting a ping to my application when the browser is open and active. Could be possible to add a route that ander to /api/ping? To speed up the pdf having the dyno running can short the conversion time a lot. For high usage we must move to a payment account on heroku.

kimmobrunfeldt commented 4 years ago

@massimoliani just as a warning: I've noticed with the demo api hosted on a free heroku dyno that some large or image-heavy pages crash the server. The reason seems to be lack of RAM. If the use case works well, no need to worry but something to be aware of.

Closing this due to inactivity from opener.