I've installed xprof to debug my suddenly very high page render times. search_api_views_views_data, shows to be loaded on every page, taking about 1600 milliseconds consistently. I have disabled every view, and index. The page render time goes back to normal once I disable the search api views module. I am using the latest memcache, with varnish.

I have updated all modules to the latest versions

Comments

drunken monkey’s picture

Category: bug » support

Yes, search_api_views_views_data() can take quite some time – but Views caches the data, so it should only be called on cache rebuilds. If it's called on every page, this is most likely no bug in this module, but either one in Views or a configuration error. Did you maybe disable caching at admin/structure/views/settings/advanced, or in some way clear the cache on every page load.
Otherwise, investigate from where this is called and why, and maybe post to the Views issue queue.

bigsyke’s picture

thank you, I will investigate this.

Edit: That's exactly what it was, shame on me. The disable views cache was checked.

Thanks again.

drunken monkey’s picture

Status: Active » Fixed
steven jones’s picture

Assigned: Unassigned » steven jones
Status: Fixed » Needs work

This is causing a huge issue for us, this function is taking around 25 seconds! to run. I'm going to look into what's taking so long.

steven jones’s picture

Assigned: steven jones » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.54 KB

Okay, firstly apologies for rolling this against e68bfc31363cb35fcf64ff27bbf2f53e06caf115 and not HEAD. Secondly I don't understand what the code is trying to do, and specifically what it's exposing to views, but essentially it looks like its trying to expose as much as it can to views.

We've added a little check to see if you've marked the field as needing indexing before descending into the item, this makes the function about 2000% faster in our setup (four indexes, lots of fields).

I suspect that this isn't the way you'd want to do this, however the performance of this function is pretty awful, and cache wipes on a busy site could cause huge load on a server, as the views data cache isn't built in a locked step, i.e. 20 requests will queue up 20 views data builds if its not in the cache.

drunken monkey’s picture

Will probably be fixed by #1231512: Use real Relationships instead of level magic in Views integration, please test the patch there.

vladady’s picture

Hello,

Does views cache work for you?

With views cache activated the facets don't appear.
This is after it is corrected a little bit to start working.

drunken monkey’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

correct spelling