Performance issue in docker container.



  • Hi. I have an issue when running reports in docker container:
    On local machine rendering of pdf report with 13 pages takes ~5 sec, but inside docker container(with hole machine resources access), the same report takes ~14 sec.
    JS report config:

    const instance = require("jsreport-core")({
            httpPort: 3000,
            reportTimeout: 180000,
            extensions: {
              "xlsx": xlsxExtension,
              "chrome-pdf": chromePdfExtension,
              "html-to-text": htmlToTextExtension,
              express: {
                inputRequestLimit: "1000mb"
              },
              assets: {
                allowedFiles: "**/*.*",
                searchOnDiskIfNotFoundInStore: false,
                publicAccessEnabled: true
              }
            },
            templatingEngines: {
              numberOfWorkers: 4,
              strategy: "http-server"
            },
            logger: {
              console: {
                // TODO: add to the env
                transport: "console",
                level:  "debug"
              }
            }
          });
          instance.use(require('jsreport-pdf-utils')());
          instance.use(require('jsreport-handlebars')());
          instance.use(require('jsreport-chrome-pdf')());
          instance.use(require('jsreport-scripts')({}));
          await instance.init();
    

    And docker file:

    FROM node:10.17.0-jessie-slim as node-dep-installer
    WORKDIR /tmp/build
    COPY ./package.json package.json
    COPY ./yarn.lock yarn.lock
    RUN yarn install
    FROM zenika/alpine-chrome:with-node
    EXPOSE 9000
    ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD 1
    #ENV NODE_OPTIONS --max-old-space-size=6096
    COPY . /home/app
    COPY --from=node-dep-installer /tmp/build/node_modules /home/app/node_modules
    WORKDIR /home/app
    USER root
    RUN [“chmod”, “+x”, “/home/app/start.sh”]
    CMD ./start.sh
    

    Does someone have an idea what could be wrong or what can be improved ?



  • This can be because of all kinds of things and likely not so much related to jsreport.
    I believe you need to try to isolate the problem before.

    Is it because of the specific template?
    Is it because of the specific HW?
    Try a different machine?
    How the perf look when you use the official docker image?



  • Ok, thanks.
    btw 'How the perf look when you use the official docker image?' - still not good. With custom image and jsreport-core - better =)


Log in to reply
 

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