• Resolved Jamie Sykes

    (@nineteen88)


    I’m running my site behind Cloudflare’s CDN and proxy to get the most performance. One of the issues I am facing with the plugin is that the reindex content script, causes timeouts from Cloudflare whenever I want to reindex content. The timeout is set to 100s with no easy way for us to change it with our hosting provider.

    I’ve had to enable this filter on my site: algolia_should_wait_on_delete_item this is due to the fact that I saw problems when savings posts where they would disappear from the site. Checking Algolia’s logs it is because the delete record function ran after the update one did.

    I’m just wondering if there are any workarounds for solving this problem?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Curious if any of these two may help https://github.com/WebDevStudios/wp-search-with-algolia/wiki/Timeouts

    I also know that we have WP-CLI integration available and I’ve learned that I can’t promise it’ll for sure help with this topic, I do believe it’d allow for reindexing away from a potentially heavier resource loaded area like WP Admin, so it’s at least worth a try.

    Thread Starter Jamie Sykes

    (@nineteen88)

    Thanks for coming back to me Michael.

    I just found a filter in the plugin to change the batch size. I’ve reduced this from 100 to 25, and this has resolved the issue as smaller amounts of data are being pushed in one go so I’m not hitting the timeout issue.

    Here’s an example which might be useful for someone else in future:

    /**
    * Reduce the batch size to ensure that we don't get timeouts when doing a full reindex of site.
    */
    add_filter(
    'algolia_indexing_batch_size',
    function () {
    return 25;
    }
    );
    • This reply was modified 1 year, 3 months ago by Jamie Sykes.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Definitely also worth trying to remove time per batch but does have the caveat of having more overall batches to process as well.

    Whatever gets the job done.

    Hi @nineteen88, the filter is to add on functions.php of active theme?

    Thanks,

    Thread Starter Jamie Sykes

    (@nineteen88)

    @tropa Yes, you can use it there or in a plugin.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Timeout reindexing content’ is closed to new replies.