Very bad performance with "Retrieve from server"?

Created on 18 June 2024, 5 months ago
Updated 3 August 2024, 4 months ago

Problem/Motivation

Hi, I'm trying search_api_autocomplete with a site with a decently big dataset - 30000+ nodes - and a search_api_db server.

I've tested on a local machine that "Display live results" suggester has good performence, about ~200 ms with display "only label".
On the other hand, "Retrieve from server" has a terrible performance, about 8/9 seconds to respond.

Looking the code, I would have expected the opposite results, as "Retrieve from the server" should do a direct sql query, while "Display live results load the Drupal entities via the API.

Is that a normal behaviour or maybe is something wrong on my setup?

🐛 Bug report
Status

Active

Version

1.9

Component

General code

Created by

🇮🇹Italy Giuseppe87

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Giuseppe87
  • 🇦🇹Austria drunken monkey Vienna, Austria

    It’s definitely not normal, the SQL query/queries (there may be two if you’ve enabled both options under “Autocomplete settings” in the search server settings) seem(s) to be especially slow on your site. Since no-one else has complained yet (as far as I remember), this seems to be specific to your setup, though, so not sure how much I can help you with that. Try debugging first to see whether it’s really the SQL queries that are the problem (e.g., by activating your SQL server’s slow query log) and, if so, debugging them to see how you might be able to improve their performance.

    If you are not a developer, there are even less options. If you have both of the mentioned options enabled, you could try whether using just one of them helps with the performance.

    However, it might also be that 30,000 nodes is just a bit much for this functionality in the DB backend. Normally, I’d say this is well into the territory where using Solr makes more sense.

  • 🇬🇷Greece TheodorosPloumis Greece

    We also have a similar issue on a SOLR 7.x server with about 100k Search API Items.
    Looking for solutions too.

    One option that seems to work better is to use the "Solr Suggester" (but this requires SOLR).

  • 🇮🇹Italy Giuseppe87

    @drunken monkey Thanks for the very quick reply.

    Unfortunately the problem is on a project of a company I am not longer working with, therefore I can't actually debug it anymore to gather more data.
    I don't know if you may want to close this issue or leave it open in case others devs could provide more insights.

  • 🇦🇹Austria drunken monkey Vienna, Austria

    @Giuseppe87: Thanks for reporting back.
    I guess we can leave this open in case someone has a similar problem.

Production build 0.71.5 2024