Skip to main contentSkip to footer

Effect of Relevanssi on page speed

A Relevanssi customer asked whether Relevanssi can slow down a site. They have a slow site and their hosting provider had suggested Relevanssi might be the reason, because Relevanssi had a huge table in the site database.

That is true – Relevanssi tables can be really big. But they’re not accessed at all except during searching, so it shouldn’t matter how big the table is. Fortunately site speed is something that can be measured, so we can make some actual experiments here.

The experiment

I used Kirjavinkit as the testing ground, because it’s one of the biggest sites I run. It has about 9,000 posts. The wp_posts database table is about 128 megabytes, with another 10 megabytes in indices, while the wp_relevanssi table is hefty 270 megabytes, with 400 megabytes of indices (this ratio of Relevanssi taking almost five times as much space as the actual posts is fairly typical.)

So, if having a big Relevanssi table slows down the site, the effect should definitely be visible on this site. I ran three tests using a speed test tool provided by my hosting provider Seravo (one of the best WP hosting companies in the world, by the way). It’s basically a pretty wrapper for curl which hits the front page 20 times in row, making multiple requests every time and averaging the times.

The results

With Relevanssi enabled, the front page loading time averages ranged from 0.161 to 0.187 seconds.

With Relevanssi disabled, the loading times were slightly faster: from 0.154 to 0.164 seconds. However, this is far from something anybody would actually notice, on average maybe ten milliseconds faster.

Then I truncated the Relevanssi database table to make sure it doesn’t have effect, and the speeds varied from 0.154 to 0.177 seconds. No noticeable difference there.

Based on this, I think it’s safe to say having a big Relevanssi database table has no effect on site loading times. If you do notice a difference on your site, that would suggest there’s something wrong.

Your account

Not logged in. Log in to see your license details.

Search

Popular Resources

Filter search results by date

You can specify date limits on searches with by_date search parameter. Here’s a link you can add to your search results page to offer your visitor the ability to restrict the search results to last day: <?php echo ‘<p><a href=”‘ . get_bloginfo(‘url’) . ‘?s=’ . get_search_query() . ‘&by_date=1d”>results from the…

WP Job Manager
Relevanssi doesn’t work with the WP Job Manager search. The solution is fortunately simple: you can just disable Relevanssi for…
Indexing only attributes from shortcodes

…do I go about this? – Duke at Remove shortcode but keep content in X parameter You can’t do this using the Relevanssi shortcode removal because that’s a binary operation: the whole shortcode is kept or removed, and there’s no way to keep only part of the shortcode. However, you…I need to add some custom shortcodes to the list of the “removed” ones (so they don’t show in plain text in the results). However, some of them are built like [shortcode_name text=”Need to keep this in results”] and I would like the content in the text parameter to stay in the results. How……the “text” attribute from the shortcode * * @param string $content Post content * * @return string Post content with the shortcode replaced with just the “text” attribute content. */ function rlv_shortcode_attribute( $content ) { return preg_replace( ‘/\ /im’, ‘\1’, $content ); } Since this particular case was about a…

Related Posts:

Currently there are no related posts available.

Comment Section:

4 Comments. Leave new

  • Hi,

    Code Profiler scan says Relevanssi is taking most of time to load, impressive 1,6s.
    Is anyone getting this same problem?

    Reply
    • Marcio, is that happening only on search results pages or does it happen on every page load? If it happens on search results pages, it’s not a problem, but fairly normal Relevanssi performance. If it’s happening on every page load, then yes, that’s a problem if you’re not doing a search.

      Reply
      • Hi Mikko, it’s happening on all admin pages, admin dashboard, users, post, etc…
        What could it be ?

        Reply
        • Try checking with Query Monitor to see what’s going on. If you are using Relevanssi Premium, it may be problems with API calls, in which case checking “Disable update version checking and attachment indexing” should stop it.

          Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed