More on slow performance of JsReports 2.2

  • Hello,
    I read about the --keepAlive option for the command line but I am looking for an option at nodejs level. I have small application with no cloud setup and IIS server is like a firewall or proxy and I have not registered my jsreport application under it.

    I don't know if my jsReport instance is sleeping so how to find out about it is my first Question?
    I don't think the slowness is just for the first time, it takes a single page report around 2s and 3-page report around 4s. This is how I am starting jsReport, Pl suggest how to add --keepAlive option.

    let startJsreport = (server, app) => {
        /// define the jsreport middleware
        let jsreport = require('jsreport')({
            extensions: {
                express: { app: reportingApp, server: server },
            appPath: "/reporting"
            .then(() => {
                console.log(`JSReport instance ${} started correctly.`);
            }).catch((e) => {
        app.use('/reporting', accessMiddleware, (req, res, next) => {
            /// user should login to the server to access the admin console     

    Thank you,

  • I want to add here that PDF-Utils are the cause of slowness. I had 2 pdf-merge operations - one to put sample watermark and other for the footer.
    Here are some stats: for 3 page document, 2 pdf-merge makes it 4 times longer and for 18 page document, its 10 times longer.

    For 3-page document with no PDFOperations - 588ms
    with sample watermark 1171ms
    with footer and sample 2443ms

    and for 18-page document with no PDF Operations 940ms
    with sample watermark 1754ms
    with footer and sample watermark 9780ms

    Maybe my footer file is not so efficient:

      {{#with $pdf}} 
        {{#each pages}}    
            {{#if @first}} <!--write one time only -->
                <table width="83%" style="margin: 10px 67px;">
                      <td align="center">
                       {{#if_gt ../pages.length 1}} <!-- page numbers if more than 1 page-->
                        <td align="right" width="5%">

  • The keepAlive is just feature of the single executable.
    It won't help when you have normal node.js based setup.

    The pdf utils is not efficient if you use "merge for every page" at this moment.
    We have some tasks in the queue to improve it. We know how, just didn't get to it yet.
    I believe we will have it ready during the next two months.

  • Thanks Jan. I will wait for the update.

Log in to reply

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