Import API performance issue: taking 10s to import a template
-
We are experiencing performance issues with import API.
API is taking around 10 seconds to import a template.
We configured azure file share for template storage and same has been mounted through container apps volume mount.Below are the logs from console:
024-08-19T08:33:46.277Z - info: Initializing jsreport (version: 4.3.1, configuration file: ./dev.config.json, nodejs: 18.19.1)
2024-08-19T08:33:46.279Z - info: Searching for available extensions in /app/
2024-08-19T08:33:46.281Z - info: Extensions location cache not found, crawling directories
2024-08-19T08:33:46.778Z - info: Found 36 extension(s)
2024-08-19T08:33:46.792Z - debug: Writing extension locations cache to /tmp/jsreport/core/locations.json
2024-08-19T08:33:46.793Z - debug: Discovered 36 extensions
2024-08-19T08:33:46.835Z - debug: Extension authentication@4.1.1 is disabled, skipping
2024-08-19T08:33:46.837Z - info: Using extension azure-storage@4.0.1
2024-08-19T08:33:46.976Z - info: Using extension base@4.0.0
2024-08-19T08:33:46.979Z - info: Using extension child-templates@4.1.0
2024-08-19T08:33:46.981Z - info: Using extension cli@4.0.4
2024-08-19T08:33:46.982Z - info: Using extension components@4.0.0
2024-08-19T08:33:46.983Z - info: Using extension data@4.1.0
2024-08-19T08:33:46.983Z - info: Using extension express@4.1.1
2024-08-19T08:33:47.134Z - info: Using extension freeze@4.0.0
2024-08-19T08:33:47.135Z - info: Using extension fs-store@4.0.3
2024-08-19T08:33:47.192Z - info: Using extension handlebars@4.0.1
2024-08-19T08:33:47.194Z - info: Using extension import-export@4.0.3
2024-08-19T08:33:47.199Z - info: Using extension jsrender@4.0.0
2024-08-19T08:33:47.200Z - info: Using extension licensing@4.0.2
2024-08-19T08:33:47.209Z - info: Using extension localization@4.0.1
2024-08-19T08:33:47.209Z - info: Using extension npm@4.0.0
2024-08-19T08:33:47.212Z - info: Using extension pdf-utils@4.1.1
2024-08-19T08:33:47.214Z - info: Using extension reports@4.1.1
2024-08-19T08:33:47.217Z - info: Using extension tags@4.0.1
2024-08-19T08:33:47.218Z - info: Using extension text@4.0.0
2024-08-19T08:33:47.219Z - info: Using extension version-control@4.0.0
2024-08-19T08:33:47.225Z - info: Using extension assets@4.1.0
2024-08-19T08:33:47.236Z - info: Using extension authorization@4.0.0
2024-08-19T08:33:47.239Z - debug: Extension authorization@4.0.0 was disabled
2024-08-19T08:33:47.240Z - info: Using extension browser-client@4.1.0
2024-08-19T08:33:47.247Z - info: Using extension chrome-pdf@4.1.0
2024-08-19T08:33:47.268Z - debug: Chrome strategy is chrome-pool, numberOfWorkers: 1
2024-08-19T08:33:47.269Z - debug: Chrome custom launch options are args=--no-sandbox,--disable-dev-shm-usage, executablePath=/usr/lib/chromium/chrome
2024-08-19T08:33:47.269Z - info: Using extension docx@4.5.0
2024-08-19T08:33:47.270Z - info: Using extension html-to-xlsx@4.1.1
2024-08-19T08:33:47.455Z - info: html-to-xlsx detected chrome as available html engine
2024-08-19T08:33:47.455Z - info: Using extension pptx@4.2.0
2024-08-19T08:33:47.457Z - info: Using extension scheduling@4.0.0
2024-08-19T08:33:47.480Z - info: Using extension scripts@4.1.0
2024-08-19T08:33:47.481Z - info: Using extension static-pdf@4.1.0
2024-08-19T08:33:47.481Z - info: Using extension studio@4.1.0
2024-08-19T08:33:47.524Z - info: Using extension xlsx@4.1.0
2024-08-19T08:33:47.526Z - info: Using extension public-templates@4.0.0
2024-08-19T08:33:47.527Z - debug: Extension public-templates@4.0.0 was disabled
2024-08-19T08:33:47.527Z - info: Using extension sample-template@4.0.0
2024-08-19T08:33:47.529Z - info: Using extension studio-theme-dark@4.0.0
2024-08-19T08:33:47.530Z - info: Code sandboxing is disabled, users can potentially penetrate the local system if you allow code from external users to be part of your reports
2024-08-19T08:33:47.530Z - info: Using general timeout for rendering (reportTimeout: 300000)
2024-08-19T08:33:47.530Z - info: Using fs provider for template store.
2024-08-19T08:33:47.534Z - info: fs store is persisting using fs for /app/data
2024-08-19T08:33:47.556Z - info: fs store is loading data
2024-08-19T08:33:48.027Z - info: fs store is initialized successfully
2024-08-19T08:33:48.033Z - debug: studio default theme is: light
2024-08-19T08:33:49.729Z - info: Creating default express app.
2024-08-19T08:33:49.742Z - info: jsreport server successfully started on http port: 5488
2024-08-19T08:33:49.743Z - info: Verifying license key free
2024-08-19T08:33:49.743Z - info: Using free license
2024-08-19T08:33:49.746Z - debug: Creating samples is disabled
2024-08-19T08:33:49.747Z - info: Initializing worker threads
2024-08-19T08:33:49.747Z - debug: Extensions in workers: base, child-templates, components, data, express, handlebars, jsrender, localization, npm, pdf-utils, reports, text, version-control, assets, browser-client, chrome-pdf, docx, html-to-xlsx, pptx, scripts, static-pdf, studio, xlsx
2024-08-19T08:33:49.943Z - info: 2 worker threads initialized in 196ms
2024-08-19T08:33:49.943Z - info: Starting temp files cleanup with 300000ms threshold
2024-08-19T08:33:49.944Z - info: reporter initializedImport Logs:
2024-08-19T08:47:53.898Z - debug: import is reading export file
2024-08-19T08:47:53.971Z - debug: import found 19 objects
Failed to refresh the file system lock [Error: EPERM: operation not permitted, utime '/app/data/fs.lock'] {
errno: -1,
code: 'EPERM',
syscall: 'utime',
path: '/app/data/fs.lock'
}
Failed to refresh the file system lock [Error: EPERM: operation not permitted, utime '/app/data/fs.lock'] {
errno: -1,
code: 'EPERM',
syscall: 'utime',
path: '/app/data/fs.lock'
}
2024-08-19T08:48:00.342Z - debug: import finishedConfig.js changes:
"fs-store":{
"persistence": {
"provider":"fs"
},"lock": {
"retry": 100,
"leaseDuration": 120000,
"enabled": true
}
}However, when i ran the same app in my local system it is working fine, taking 1-2 seconds to import the same template.
Please suggest.
-
Do you experience the same on the latest?
Do you have the app and the file share in the same Azure region?
Have you tried the premium low-latency file share layer?The import uses a transactional approach to keep the files consistent in the case of accidental crashes.
This requires a lot of writes to possibly low latency drive.
-
Check my response below. Can you also confirm do you have any plan to enable jsreport to store templates in Azure Blob Storage with managed identity?
Do you experience the same on the latest? I tried with 4.5, 4.6 as well
Do you have the app and the file share in the same Azure region? Yes
Have you tried the premium low-latency file share layer? I verified with 'Premium' tier storage account. I can see no difference in performance.