Docker performance issues



  • We're in the process of upgrading jsreport from version 2.11 to 4.3.1 and are experiencing some performance issues. While HTML script execution within our jsreports has sped up, the overall time to generate PDFs has significantly increased. This slowdown is particularly pronounced with our larger reports but is noticalbe with some reports that use to take <1min not take about 2 min.

    In our AWS lab environment and on Docker Desktop, we've observed a consistent performance degradation of 25-50% compared to running outside Docker, where version 4.3.1 is noticeably faster.

    Our Docker configuration uses a custom Ubuntu 22.04 base image tailored with specific dependencies needed for our projects. We initially used the full jsreport Dockerfile and made necessary modifications to integrate our base image. Additionally, we tested with the default jsreport Dockerfile, not using our custom Ubuntu image. Our test servers are well-resourced with more than enough memory and cpu.

    We have tried various Chrome strategies, worker configurations, and numerous argument flags. We've also explored other configuration options as suggested in discussions like this one: https://forum.jsreport.net/topic/3055/jsreport-performance

    Could anyone provide insights or suggestions on what might be causing these performance issues within the Docker container? Any advice would be greatly appreciated.



  • In our experience, the chrome performance fluctuates between versions. It can be easily 20% slower on some HTML in the version used in 4.3.1 compared to version in 2.11. It is quite random, so we have not much to do with it.

    Unfortunately, I see you have tried all my recommendations. I would expect the biggest perf improvement gain in disabling the ARIA which is likely disabled by default in 2.11 chrome.

    The performance between docker and host could be in usage of GPU. Don't you have a GPU on the server which could be used by Chrome on host but not in docker?



  • This might be completely unrelated, but I gained much in performance when I migrated from child reports in 2.11 to components in v3.

    Most of the gain was due to my misuse of child reports. In my calls to the child reports I added data, sometimes quite a lot of data. I didn't realise that the calls to child reports would copy all the data. This was very taxing on the memory on my server, especially when multiple large reports were rendered.

    Even if you are not misusing child reports, as I did, I think components are a much nicer concept.

    Jan, what do you mean by "disabling the ARIA"? Where can I do this?



  • Jan, what do you mean by "disabling the ARIA"? Where can I do this?

    https://jsreport.net/learn/chrome-pdf#aria

    <html>
        <body aria-hidden="true">
    
        </body>
    </html>
    


  • We did figure out the performance issue for us was using headless: new, with this turned on we saw consistently slower report generation times. Though some of our largest reports with lots of canvases and images still won't generate it is a step in the right direction.

    @msageryd Thanks for the info. We don't actually use childTemplate at all we utilize pdf-utils as we have different page orientations we need to support.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.