Welcome Guest Search | Active Topics | Sign In | Register

HtmlToPdf.MaxConcurrentTaskCount Error Options
Medavante
Posted: Friday, May 7, 2021 8:28:25 AM
Rank: Newbie
Groups: Member

Joined: 6/1/2020
Posts: 2
EO.Pdf 2020

Seeing this error while generating many PDFs.
Can not create additional conversion task. Please increase HtmlToPdf.MaxConcurrentTaskCount.

Current setting is 200 and we are not generating or having 200 tasks executed.


EO.Pdf.HtmlToPdfException: Can not create additional conversion task. Please increase HtmlToPdf.MaxConcurrentTaskCount.
at EO.Internal.ioat.ienc(vhrv bse, ioar& bsf)
at EO.Internal.ioaw.isuv()
at EO.Internal.ioaw..ctor(vhrv bsj, HtmlToPdfOptions bsk)
at EO.Pdf.HtmlToPdfSession.tcqd(HtmlToPdfOptions yn)
at EO.Pdf.HtmlToPdfSession..ctor(HtmlToPdfOptions yl, HtmlToPdfSession ym)
at EO.Pdf.HtmlToPdfSession.Create(HtmlToPdfOptions options)
at EO.Pdf.HtmlToPdf.mbpg.gydk()
at EO.Internal.ioat.fqfx[a](dnum`1 bsi)
at EO.Pdf.HtmlToPdf.ConvertHtml(String html, PdfDocument doc, HtmlToPdfOptions options)
at EO.Pdf.HtmlToPdf.ConvertHtml(String html, String pdfFileName, HtmlToPdfOptions options)


eo_support
Posted: Saturday, May 8, 2021 10:38:38 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

200 is not a realistic number. The default is 25. Each concurrent task is similar to a tab in Google Chrome browser. So having 200 tabs at the same time is neither practical nor good for performance.

The fact that you have hit this limits can mean two things: either you did hit this limit, or there is something wrong in our library that fails to release the internal resource/counter. The verify whether it's the first case, you can add some counter in your code to count how many tasks you have currently running (for example, increase the counter by 1 before you call ConvertHtml and decrease by 1 after you call ConvertHtml), to avoid the second issue, you can try to update to the latest build from our download page.

Please keep in mind that hitting this error maybe completely normal. This limit it there to prevent your system from severely overloaded (thus affecting other things). So for example, if you hit the default limit (25) when your system is 80% busy, then increasing MaxConcurrentTaskCount will not solve the problem for you at all because the root of the problem is your system can't completely those tasks fast enough. So while increasing MaxConcurrentTaskCount from 25 to 200 will allow more tasks to be started, each tasks will take significantly longer to complete and in the end it will hit the newly increased limit too. However if you hit the default limit when your system is only 20% busy, then most likely increasing MaxConcurrentTaskCount will help your situation.

The key is MaxConcurrentTaskCount exists as a safely threshold and it's normal for safety threshold to cut off sometimes. While sometimes the exact value of the safety threshold requires some tuning, blindingly increasing the safety threshold is not the solution.

Hope this makes sense to you.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.