Wkhtmltopdf: How to set timeout?

Created on 15 Nov 2015  路  3Comments  路  Source: wkhtmltopdf/wkhtmltopdf

I've just found wkhtmltopdf on my linux machine was working for the last 28 minutes eating 99% of CPU and effectively killing the server. Can I set some kind of timeout so it it can't create a PDF within 30 seconds it dies?

Question

Most helpful comment

Is something like this viable ?

xvfb-run -a -s "-screen 0 640x480x16" \
    timeout --preserve-status 40 -k 60 \
    wkhtmltopdf http://www.qwamci.com/ /tmp/qwam.pdf

All 3 comments

You'd have to do that outside of wkhtmltopdf.

Closing as the answer was provided.

Is something like this viable ?

xvfb-run -a -s "-screen 0 640x480x16" \
    timeout --preserve-status 40 -k 60 \
    wkhtmltopdf http://www.qwamci.com/ /tmp/qwam.pdf
Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikereape picture mikereape  路  3Comments

rohitmyaim picture rohitmyaim  路  3Comments

ArthurianX picture ArthurianX  路  4Comments

ErnstTmp picture ErnstTmp  路  4Comments

monejava picture monejava  路  4Comments