nextcloud / news-updater

:newspaper: Fast, parallel feed updater for the News app; written in Python
GNU General Public License v3.0
107 stars 23 forks source link

News updater is consuming a lot cpu #43

Closed gldhnchn closed 9 months ago

gldhnchn commented 9 months ago

I recently noticed, that the nextcloud news updater is consuming a lot of CPU. Is this an expected behavior or is this a sign that something may be misconfigured?

Here you can see the peaks in cpu usage, produced every 15 min by nextcloud news updater: grafik

The updater is running as systemd service with the following config:

[updater]
# only needed when using the REST API
#user = admin
# only needed when using the REST API
#password = admin
threads = 10
interval = 900
loglevel = error
# or https://domain.com/nextcloud when using the REST API
url = /var/www/nextcloud
phpini = /etc/php/8.1/cli/php.ini
# or v2 which is currently a draft
apilevel = v15
mode = endless
# path to php binary
php = /usr/bin/php

systemd:

[Unit]
After=default.target

[Service]
Type=simple
User=www-data
ExecStart=/usr/bin/nextcloud-news-updater -c /etc/nextcloud/news/updater.ini

[Install]
WantedBy=default.target

Installed with pip, version 11.0.0.

BernhardPosselt commented 9 months ago

Reduce the concurrent threads

gldhnchn commented 9 months ago

Nice, thank you for this easy advice. I first put it down to 4, and now to 1. And I also increased the interval to 1800s. I think that's also fine for me. The update now takes a little bit longer (of course).

grafik