Hi,
While building an app that relies on ou jsonapi endpoint we bumped into a kind of a performance issue.
The problem is likely solvable by tweaking the mysql config, but I think it's something interesting to get your ideas on.
The app needs to query lets say 50 or so identical calls, only one fixed field value is different for each request.
Consequently there is the same query repeated over and over every time, but it can't be a prepared statement, as the statement would be rebuilt for every new request.
All goes fine for a while, but after a number of queries, things start going very slow. Investigation into mysql ('copying to tmp table') led me to tweak the tmp_table_size and the heap table size etc. This helps in pushing the number of queries it takes before it starts behaving badly. But there seems to be always coming a point where things come to a halt.
I don't know enough on mysql to understand why a very similar query repeated with different parameter values starts degrading after a while.
Are there other ways to improve this outside of mysql/inside of drupal?
The query contains 10 joins, if that would be relevant.
thx for any thoughts.
Pieter
Comments
Comment #2
pieterdt commentedhmm, during my investigation I forgot to clear the caches in drupal in between tests, so that explains why it goes well for a while and then starts going wrong. As soon it needs to go to the db it immediately triggers.
Any tips on mysql are welcome, but I think the issue cannot be improved from within json api.