Skip to content
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

Enabling the app significantly slows down Nextcloud 24.0.6 installed via snap #1026

Closed
rileytroyer opened this issue Nov 9, 2022 · 9 comments

Comments

@rileytroyer
Copy link

My instance of Nextcloud was performing significantly slower than I would expect and I finally tracked the issue down to this app. When I disable the app everything is much faster. This is especially true of rendering thumbnails created with the previewgenerator app. As a quick test navigating from the files app to the dashboard took anywhere from 7-15 seconds for everything to load with the app enabled and 3 seconds with it disabled. I tested this multiple times just to confirm. I don't need the app (I hadn't actually used it yet just downloaded and enabled), so I'm fine just not using it, but something seems to be misbehaving.

Steps to recreate:

  1. Create an Ubuntu Server 22.04 virtual machine in VirtualBox.
  2. Install Nextcloud snap package.
  3. Install Music app and don't adjust any other settings.

I was experiencing the slowdown both accessing the instance over localhost and via the domain name, which is routed through a Cloudflare reverse proxy.

Output of config file:
{
"system": {
"apps_paths": [
{
"path": "/snap/nextcloud/current/htdocs/apps",
"url": "/apps",
"writable": false
},
{
"path": "/var/snap/nextcloud/current/nextcloud/extra-apps",
"url": "/extra-apps",
"writable": true
}
],
"supportedDatabases": [
"mysql"
],
"memcache.locking": "\OC\Memcache\Redis",
"memcache.local": "\OC\Memcache\Redis",
"redis": {
"host": "REMOVED SENSITIVE VALUE",
"port": 0
},
"log_type": "file",
"logfile": "/var/snap/nextcloud/current/logs/nextcloud.log",
"logfilemode": 416,
"instanceid": "REMOVED SENSITIVE VALUE",
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": {
"0": "127.0.0.1:2580",
"2": "nextcloud.example.com"
},
"datadirectory": "REMOVED SENSITIVE VALUE",
"dbtype": "mysql",
"version": "24.0.6.1",
"overwrite.cli.url": "nextcloud.example.com",
"dbname": "REMOVED SENSITIVE VALUE",
"dbhost": "REMOVED SENSITIVE VALUE",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"installed": true,
"preview_max_x": "2048",
"preview_max_y": "2048",
"jpeg_quality": "60",
"overwriteprotocol": "https",
"memories.exiftool": "/var/snap/nextcloud/31751/nextcloud/extra-apps/memories/lib/../exiftool-bin/exiftool-amd64-glibc",
"maintenance": false
},

@paulijar
Copy link
Collaborator

Thanks for the report.

I now finally had time to install Virtualbox and Ubuntu Server 22.04. I selected also the Nextcloud snap to be installed during the Ubuntu installation. When the Ubuntu booted up, I installed the desktop environment and Firefox:

sudo apt-get install ubuntu-desktop
sudo apt-get install firefox

With this setup, I could reach Nextcloud by navigating to localhost from Firefox. However, I couldn't see any difference in the performance before and after activating the Music app. Navigating from Dashboard to Files or vice versa always took 2-3 seconds, regardless.

On my Nextcloud instance, I had only a few files if that matters.

@rileytroyer
Copy link
Author

Sorry for the delayed response. I've been traveling and am still away from the computer that I have the test VM installed on. However, I can try to test it out a bit more when I get back.

I do believe I have somewhere between 50-100 images on the install I tested on, so perhaps those made the difference. I have on the order of 10,000 images on my actual Nextcloud install where I first encountered the issues as well.

paulijar added a commit to paulijar/music that referenced this issue Jan 1, 2023
Previously, the bootstrapping code of the Music app used to do some
unnecessary processing on many HTTP requests where it wasn't really
needed. This was because the regular expressions identifying the Music,
Files, and Share app URLs were too permissive. Now the regex's are more
focused and executed so that short circuit evaluation will be utilized.

The issue owncloud#1026 might be
related to this but I haven't been able to reproduce the problem.
@paulijar
Copy link
Collaborator

paulijar commented Jan 1, 2023

I still couldn't reproduce the problem when I uploaded ~150 image files on the NC snap running on Ubuntu on VirtualBox. This time I tested with the NC25-prerelease snap.

In the new Music v1.8.0 release, I did some small changes on the bootstrapping logic of the app which may or may not help on the reported issue.

@rileytroyer
Copy link
Author

Finally back to my main computer. I was able to recreate the issue again starting from scratch with these steps

  1. Install Ubuntu server on a VirtualBox VM giving it 6GB RAM and 2 cores.
  2. Create a port forward in VirtualBox of guest:80 to host:2580 so that I can access the UI from the host.
  3. Install Nextcloud Snap package 25.0.2 sudo snap install nextcloud.
  4. Sign into Nextcloud via the browser pointed to 127.0.1:2580 and install all the recommended apps.
  5. Create a directory under documents and add 262 PNG images to it totaling ~70MB.

With this setup the installation seems snappy and as before when navigating between Files and Dashboard the various elements loaded quickly.

However, when I download and enable Music v1.8.0 and perform the same navigation test the page elements load noticeably slower. Upon enabling, this seems to take a few clicks/interactions with the UI for it to become obvious maybe ~10. The biggest slowdown I've noticed is for the calendar widget on the Dashboard.

For consistency with what you tried I also then installed the desktop environment and Firefox on the VM and got the same behavior with this.

Finally, I was able to do the exact same procedure on a completely separate host machine (MacBook). The first computer was a bit older with a HDD, the MacBook has a SSD. The behavior was less noticeable on the Mac, but still measurable.

@ElenAd451
Copy link

Did it get fixed? I use this player as well, and I've been thinking of upgrading, but I don't want to struggle with anything like that because I have a pretty good music collection on my phone, thanks to Tubidy. I don't want to spend a lot of time looking for a decent player because it used to be a real challenge for me, and this one is the most convenient for me. It would be a pity if this problem still exists.

@paulijar
Copy link
Collaborator

@ElenAd451 Nothing has been fixed, but no-one else has reported any issues like this. So probably it doesn't affect most users or the effect is not significant enough to bother them. It's still unknown, what are the exact requirements for this problem to occur. When you say you have been thinking to update, did you mean that you would be updating your version of Nextcloud? Or Music app? But anyway, it has not been proved that the version of either of these would be a significant factor on this problem (although it could be).

@paulijar
Copy link
Collaborator

Hello @rileytroyer. Are you still experiencing this problem when running Music v2.0.0 on some recent Nextcloud version? This latest Music release changes the application bootstrapping logic which could make a difference, perchance.

@rileytroyer
Copy link
Author

Hello @paulijar Sorry for the delay in reply. I removed the app after the issues and haven't tried installing it again. I'm travelling right now, but can try when I get back and see if the issue persists. I've since moved my instance to to the NixOS Nextcloud package, but also still have my snap version running, so will test on both and report back.

@rileytroyer
Copy link
Author

Hello @paulijar Sorry for the delay in reply. I removed the app after the issues and haven't tried installing it again. I'm travelling right now, but can try when I get back and see if the issue persists. I've since moved my instance to to the NixOS Nextcloud package, but also still have my snap version running, so will test on both and report back.

I finally got some time to test the updated app v2.0.0 on both my old Snap install running on a hard drive and on my new NixOS install running on an SSD. I was unable to notice any slowdown, so it appears the issue is resolved. I'll keep the app installed and reopen the issue if I notice a slow down in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants