mirror of
https://github.com/floccusaddon/floccus.git
synced 2026-04-25 14:16:12 +03:00
[GH-ISSUE #476] High Load in Nextcloud at sync #350
Labels
No labels
browser-specific
bug
correctness issues
enhancement
feature: Google Drive
feature: Linkwarden
feature: git
feature: nextcloud-bookmarks
feature: tabs
feature: webdav
help wanted
native-app
priority: high
priority: low
priority: medium
pull-request
question
question
stale
upstream
waiting for more information
wontfix
🙁 Not following issue template
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/floccus#350
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @superwinni2 on GitHub (Mar 24, 2020).
Original GitHub issue: https://github.com/floccusaddon/floccus/issues/476
Describe the bug
When I try to sync my booksmarks with my nextcloud, my cloud gets a very high load at about ~5-9
Cloud is installed on LXC on Proxmox. 4 Cores. 1.5 GB RAM 10 GB of memory.
Everything is good until I start sync in floccur. RAM runs full from 165 MB to 1,3 GB + a little bit of SWAP. Also the sync fails.
At beginngs when I used floccus there wasn't such problems. For normal use my nextcloud got ~256 MB RAM and only one core. I gave it more because of the problems.
Expected behavior
Normal Load and RAM usage on nextcloud when syncing.
Desktop (please complete the following information):
Server (please complete the following information):
Debug log
See in your Cloud :)
@forrestab commented on GitHub (Apr 9, 2020):
I would just like to add, I didn't see this problem on nextcloud@17 and started noticing it after upgrading.
I am running nextcloud in a docker container on unraid.
@superwinni2 commented on GitHub (Apr 9, 2020):
I found out what it was today...
After some search, I found out, that if I'm taking my IP which I'm connecting to into the (bruteforce) whitelist, it's working again...
But I don't know why so.... I haven't changed any settings in floccus or account details in nextcloud. Due to that, after setting the whitlisted IP, everything was working like normal again.
Also tried it out on another Cloud... Same error... There are going to be some bookmarks synchronisized and after some times, there will be the error....
Btw... Some bookmark mean about 76 Bookmarks somewhere between 29 folders which has been synchonised... Some doubled at the server... On my client I*ve got about ~130 in 41 folders...
@marcelklehr commented on GitHub (Apr 9, 2020):
Ah, yes. Floccus can potentially trigger the brute force app :/
@superwinni2 commented on GitHub (Apr 10, 2020):
Okay... :/
Do you have any idea why?
@marcelklehr commented on GitHub (Apr 10, 2020):
Floccus makes a lot of requests for syncing, especially on the first run when a lot of bookmarks have to be created.
@marcelklehr commented on GitHub (Apr 23, 2020):
Bookmarks v3 will hopefully reduce server load significantly.
@mobamoba commented on GitHub (May 4, 2020):
I'm having this problem with 3.08 of Bookmarks. I reported high CPU usage in the Bookmarks git because I'm not sure if the problem is with Bookmarks or Floccus but having Floccus enabled wipes out my system's RAM and CPU. It was working fine until recently and nothing changed at my end.
I have Floccus on 3 different browsers and the only way to make it work is to disable it in each browser then turn them back on one at a time. Thus it would seem that the problem is that there's no queuing with the various Floccus instances, i.e. each of them is hitting Nextcloud at the same time and overwhelming the system.
@superwinni2 commented on GitHub (May 5, 2020):
Looks likethe same problem of mine...
Too many requests in an amount of time so the nextcloud "bruteforce" protection is blocking the connection...
Try whitelistening the IP from where you are trying to connect. One after another. After everything is synced you can delete the whitlists again.
Did the same and now everything works like it should.
@mobamoba commented on GitHub (May 7, 2020):
Unfortunately that didn't solve my problem. It happens every single time Floccus syncs (1 Firefox and 2 Chrome instances). And I access my Nextcloud from a dynamic IP so have no real way to whitelist anything in the Brute Force settings.
Since there's realistically no need to all instances of Floccus to sync at the same time, is there a way for the app the check and see if another Floccus instance is syncing and, if so, wait 5 minutes before trying again?
@marcelklehr commented on GitHub (May 7, 2020):
@mobamoba With the bookmarks app that's not possible, but the WebDAV method does exactly that.
@kai-uwe-rommel commented on GitHub (May 8, 2020):
I see the same problem. I have Floccus 4.1.0 in Firefox 76. When I sync the bookmarks menu, the sync takes 16 minutes (!). At the server end I have Nextcloud 17.06 with the Bookmarks 3.0.12 app. During the 16 minutes of sync, the Nextcloud server is at 100% CPU, it has 2 cores (Xeon 2.0 GHz) and 4 GB RAM, it is a VM in a vSphere cluster. The Brute Force Whitelist does not help. I wonder what Nextcloud/Bookmarks is doing with all those CPU cycles ...
@marcelklehr commented on GitHub (May 8, 2020):
@kai-uwe-rommel How many bookmarks do you have? Have you enabled APCu/some other form of caching on the server? How long is your PHP execution timeout?
@kai-uwe-rommel commented on GitHub (May 8, 2020):
Difficult to count the bookmarks. I estimate about 50 folders with around 500 ... 1000 bookmarks. PHP execution timeout is 3600 seconds. I did not install any extra caching solution (e.g. Redis). I don't know about APCu? Probably I should have opcode caching? Whenever I upgrade Nextcloud it complains and warns me that I do not have but should have opcode caching. A couple of time I already spent some time to make sure I have enabled opcode caching and I am pretty sure I have set everything correctly but Nextcloud still complains. Form googling around I gathered that this seems to be a "known" problem ... more people seem to see this issue.
@kai-uwe-rommel commented on GitHub (May 8, 2020):
I have installed APCu now. No change of the problem.
@marcelklehr commented on GitHub (May 8, 2020):
APCu should allow progressive caching of folder hashes, so that the server state can be compared to the browser state very quickly. It might take a while for the cache to "warm up", though.
@mobamoba commented on GitHub (May 8, 2020):
I've had APCu caching for ages and I still have this problem.
@marcelklehr commented on GitHub (May 8, 2020):
Mmh. You could enable profiling in PHP and examine the profiler output (or send it to me to analyze it), to find out where it spends that time.
@kai-uwe-rommel commented on GitHub (May 8, 2020):
Can you tell me how to do this profiling? I am not really familiar with PHP. Thanks!
@marcelklehr commented on GitHub (May 8, 2020):
See https://stackoverflow.com/a/21145/5508501
@mobamoba commented on GitHub (May 9, 2020):
I don't know if this will help but I disable Brute Force and disabled Floccus on 2 Chrome instance so literally the only Floccus instance I was running was on Firefox. It still goes to 100% and grinds my machine to a halt. In other words, the problem is not Brute Force (since it's disabled) nor is it multiple instances running at once (since there was only one instance running); it's something though I don't know how to you debug it.
@marcelklehr commented on GitHub (May 10, 2020):
It might be hash calculations for the tree comparison, but those should be cached.
@kai-uwe-rommel commented on GitHub (May 10, 2020):
I did not have time yet to tackle xdebug. However it looks like since I added APCu, the 100% CPU peak became much narrower. Instead of 15 minutes it now takes only 3 for a sync of my bookmarks menu. Impressive, if it stays this way. I have also much increased the sync interval (because I only change bookmarks in my main browser) to 8 hours so the load from this on my Nextcloud instance should become negligible. Before it caused an almost constant 40% load (on average).
@mobamoba commented on GitHub (May 10, 2020):
I just double-checked my phpinfo and, yes, apcu, memcached, redis, & zend opcache are all up and running so if it is the hash calculation you mentioned then for whatever reason perhaps it's not being cached.
@kai-uwe-rommel commented on GitHub (May 15, 2020):
See my comment from 5 days ago. The situation has stayed this way. So for me the problem is more or less solved. APCu caching has significantly improved the situation. And I was able to further lessen the load by much increasing the sync interval (because not needed so often). I do not currently have time available to spend on xdebug'ing this case.
@ghost commented on GitHub (Jun 5, 2020):
I have to report the same problem: On the Nextcloud server the load is about 90 %, several php-fpm7.3 processes come up. On the client the process WebExtensions does a load of about 80 %.
Server:
Raspbian Buster
Nextcloud 18.0.4.2
Bookmark app 3.0.13
Client:
Ubuntu 18.04
Firefox 77.0.1
Floccus 4.2.0.5
I have more than 3.000 objects in oc_bookmarks and about 375 objects in oc_bookmarks_folders.
@stlehmann commented on GitHub (Oct 23, 2020):
I have the same problem with Nextcloud 20 and Bookmarks 4. Very high load on the server when syncing with Floccus.
How about limiting the number of sync calls per seconds in Floccus? There could be a parameter for this. I wouldn' t mind if Floccus syncs slowly in the background for a longer time duration. But a massive workload on the server is potentially problematic especially if multiple clients try to sync at the same time.
@omocinteractive commented on GitHub (Oct 26, 2020):
Same problem - very high load with v3.4.4 on Ubuntu 16.04/NC 19 and a good performed hardware server.
@marcelklehr commented on GitHub (Oct 27, 2020):
I can confirm this. It's a regression in the server app. v3.4.5 is out now, which should fix this. v4.0.1 will be released soon with the same fix.
@marcelklehr commented on GitHub (Oct 29, 2020):
Releases are out. Closing. Shout, if this is not fixed for you.
@stlehmann commented on GitHub (Oct 29, 2020):
Thanks @marcelklehr. I just tried the new release and server load looks great. Thanks loads.
@faaaaabi commented on GitHub (Nov 6, 2020):
Is still have massive CPU load when using Bookmarks v4.0.5, Floccus v4.4.6, Nextcloud v20.0.1 in combination with syncing floccus. MySQL process list shows following (short):
(long):
Seems to be busy with creating an index for sorting
@mnalis commented on GitHub (Nov 10, 2020):
@faaaaabi what might be interesting is if you could paste the output of mysql commands in nextcloud DB:
EXPLAINcommand), so in this case:@faaaaabi commented on GitHub (Nov 13, 2020):
Sure, here you go
@faaaaabi commented on GitHub (Jan 16, 2021):
Did you gather any new inside, yet @mnalis ?
@marcelklehr commented on GitHub (Jan 16, 2021):
@faaaaabi Could you open a new issue for this, please? It looks like some indices for oc_bookmarks are broken or don't get updated or are stuck updating.
@github-actions[bot] commented on GitHub (Mar 21, 2023):
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.