PDF_on_submit is getting request timeout

I have a custom doctype in which list out multiple customer. When this doctype is submitted new documents is created for every customer and a pdf is attached along with it. Customer count may go above 70 or something. So when I submit this file pdf_on_submit is throwing Request Timeout error. I tried to increase timeout but still it is taking too much time and throw Request Timeout. Please help.