nextcloud / photos

📸 Your memories under your control
GNU Affero General Public License v3.0
573 stars 62 forks source link

strange long sql quries when showing your photos (chronologcially ordered) with talk enabled #1418

Open jjqoie opened 1 year ago

jjqoie commented 1 year ago

Describe the bug Since quite some time I observered the problem that while showing your photos (chronologically ordered view) long and slow sql quires are created and appearing in the mariadb slow.log - please also see https://help.nextcloud.com/t/your-photos-generates-long-sql-queries/131019 Even updating several time to the latest nextcloud and photos version the problem was always there. Also migrating from nginx to apache didn't change it. Currently I'm on nextcloud 24.0.5 and photos 1.6 and problem is still there and here I noticed that when nextcloud talk is disabled, this long/slow queries are not made anymore and the "your photos" is responsing super fast, fetching the next batch of pictures.

my.cnf

[server]
skip_name_resolve = 1
innodb_buffer_pool_size = 8192M
innodb_buffer_pool_instances = 4
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 32M
innodb_max_dirty_pages_pct = 90
query_cache_type = 1
query_cache_limit = 4M
query_cache_min_res_unit = 2k
query_cache_size = 128M
slow_query_log = 1
slow_query_log_file = /var/log/mysql/slow.log
long_query_time = 1
general_log_file = /var/log/mysql/general.log
general_log = 0

[client-server]
# Port or socket location where to connect
# port = 3306
socket = /run/mysqld/mysqld.sock

# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

[client]
default-character-set = utf8mb4

[mysqld]
character_set_server = utf8mb4
collation_server = utf8mb4_general_ci
transaction_isolation = READ-COMMITTED
binlog_format = ROW
innodb_large_prefix=on
innodb_file_format=barracuda
innodb_file_per_table=1
tmp_table_size= 512M

Any other configuration of interest?

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Photos'
  2. Click on 'your photos' where it shows picture chronologically ordered (should be default page)
  3. Scroll down
  4. See the loading circle for 4-5sec until the next batch of icons are shown and preview pictures get loaded

Expected behavior As with talk disabled next batch of pictures should be fetched much faster/ instantaneously

Screenshots none

Desktop (please complete the following information):

Browser log

---

Additional context Add any other context about the problem here.

jjqoie commented 1 year ago

Just test photo 2.0 on nextcloud 25 - long queries are still there but the front end is better dealing with it...

jjqoie commented 1 year ago

with nextcloud "talk" disabled long query is not occurring but I don't get the dependency between photo mysql query and the talk app...