-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debian package is slow to install on some devices, may cause timeouts. Related to node_modules size #88138
Comments
Pinging @elastic/kibana-operations (Team:Operations) |
@bnewbold, you're correct that the 15 minutes seems VERY slow. I brought up an e2-medium (2 vCPUs, 4 GB memory) instance on GCP with standard persistent disk running Ubuntu Focal 20.04 and am seeing under 30 seconds.
What disks are you using? Is there any other activity on this machine, or the underlying drives? |
This comment contains more information gathered. The summary is that package installation took about 7.5 minutes with default settings, on a modern spinning hard disk. Running dpkg with a special I don't have detailed log of my >15 minute experience previously, and didn't reproduce such a long install time, or timeouts/failure. That was running in a different command and context (ansible), and the VM was in a different state (running elasticsearch and metricsbeat, etc, though minimal traffic or indexing happening). It might have been human error or misunderstanding on my part. This debian wiki page has some background on dpkg slowness in general: Why is dpkg so slow when using new filesystems such as btrfs or ext4? There is a single 12 TByte hard disk (not SSD), which does not use "shingling" technology. I don't have the exact part number available (due to virtualization), but I can hunt it down if it is important. There is a single filesystem partition and a small swap partition; I have not seen any evidence that swap is getting hit at all. There 6 vCPU cores and 16 GBytes of RAM. This is on a shared server, but the VM has CPU, RAM, and disk are all allocated exclusively to this VM; this is self-hosted hardware, not a cloud instance. Here are the filesystem and mount settings are:
I ran the other two commands from above:
I wiped and installed the operating system to have a clear slate, then installed kibana using
In the first 30 seconds or so while the command was running I checked
and then again after a couple minutes (command still running):
I also ran
As an experiment, I un-installed kibana and tried dpkg with a special unsafe flag to skip filesystem synchronization:
Then un-installed and re-installed again with the original command to verify that there wasn't caching or something fishy going on:
|
Per my above findings, the default install process on spinning disk is still pretty slow (7+ minutes), though not as long as initially thought. The root of the problem seems to be I generally find apt/deb/dpkg installation quick and reliable to work with; this is the first time I have experienced a problem like this. Having way fewer files installed, or being able to "bundle" or load files from an indexed archive (like zip files), would be nice. But perhaps is at odds with current nodejs/npm workflows. This may not be a high priority problem if most users are installing on SSD disks these days. Though I would note that there are probably many folks out there with alternative devices (Raspberry Pi? or other embedded flask disk) or low-cost hosting setups who might be impacted. For people installing manually, the |
We've dropped the file count by about 20% since 7.13 (8.2 at this time of writing). There's more work to do, but the slower sort of narrowing our list of dependencies. I'm going to close this out as expected behavior for now. |
This is a re-opening of bug #17176 ("Investigate slow package installs"). That bug was closed when a PR was merged to use
static-fs
for thenode_modules
directory (in March 2020), but that PR was subsequently reverted in #67135 (May 2020).I would infer from the earlier issue that the problem is that the package is installing tens of thousands of files under
/usr/share/kibana/node_modules
, which contains hundreds and hundreds of vendored libraries. Perhaps some of these could be pruned? I don't have much experience with nodejs/javascript, but it looks like there are puppeteer and vscode packages being vendored, which seem like developer tools that aren't needed when deployed. Or, speculating, a tool likeeatmydata
could be used in the debian install process to skip file system syncs until all files have been written.Kibana version: 7.10.1
Elasticsearch version: 7.10.1
Server OS version: Ubuntu Focal 20.04 (amd64, 6x CPUs, 16 GByte RAM)
Browser version: N/A
Browser OS version: N/A
Original install method (e.g. download page, yum, from source, etc.):
deb https://artifacts.elastic.co/packages/7.x/apt stable main
Describe the bug: When installing the debian package, either via
ansible
or locally, thedpkg
command takes a very long time (>15 minutes, which causes timeouts and leaves apt/dpkg in a half-installed state.Steps to reproduce:
sudo apt install kibana=7.10.*
The text was updated successfully, but these errors were encountered: