• This plugin looks perfect for our needs for a project, however it seems the plugin uses many resources and it runs out of memory, even when over 1gb is available via WP_MAX_MEMORY_LIMIT. I’m not able to load the main ‘Generate images’ page.

    For reference the site has about 50,000 posts.

    Is there any way to adjust the settings so the resource consumption on the Generate page isn’t so intensive for large sites with many images? Thanks for any insight.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello.

    The “Generate images” page does not consume resources at all.
    Only after the generation is started. So the reason is something else. Can you view the error logs?

    Thread Starter Marty

    (@bozzmedia)

    My understanding is it does use resources to create the list of posts. I had similar issues loading the WP core Posts list in the admin. I think because the plugin loads a feature image column in the list.

    The logs indicated loading either of these pages in the admin led to a failure to allocate enough memory.

    The plugin does not generate a list of posts when loading the Generation page. Moreover, the plugin does not work on other pages in the admin panel in any way. You need to do site profiling. Maybe the Query Monitor plugin will help you

    Thread Starter Marty

    (@bozzmedia)

    Apologies I got confused with a separate plugin about the image column on posts. However, when using Query Monitor I see two queries flagged as expensive about 1s each:

    SELECT DISTINCT wp_posts.*
    FROM wp_posts
    LEFT JOIN wp_postmeta
    ON ( wp_posts.ID = wp_postmeta.post_id
    AND wp_postmeta.meta_key = '_thumbnail_id' )
    LEFT JOIN wp_postmeta AS mt1
    ON ( wp_posts.ID = mt1.post_id
    AND mt1.meta_key = 'skip_post_thumb' )
    WHERE 1=1
    AND ( wp_postmeta.post_id IS NULL
    AND mt1.post_id IS NULL )
    AND wp_posts.post_type = 'post'
    AND ((wp_posts.post_status = 'publish'))
    GROUP BY wp_posts.ID
    ORDER BY wp_posts.post_date DESC

    Plugin: auto-post-thumbnail

    SELECT t.*, tt.*, tr.object_id
    FROM wp_terms AS t
    INNER JOIN wp_term_taxonomy AS tt
    ON t.term_id = tt.term_id
    INNER JOIN wp_term_relationships AS tr
    ON tr.term_taxonomy_id = tt.term_taxonomy_id
    WHERE tt.taxonomy IN ('category', 'post_tag', 'post_format')
    AND tr.object_id IN

    (followed by a long array of post ids)

    Plugin: auto-post-thumbnail

    Thread Starter Marty

    (@bozzmedia)

    The same massive query similar to the second is run when I am able to get the Generate images page to load.

    The callers are:

    WP_Term_Query->get_terms()

    update_meta_cache()

    (Just a reminder we have 50,000 posts)

    Thanks for your help.

    The first request is actually executed on this page to count the number of posts with and without an image. But the execution time of 1 second is not so much to cause memory overflow problems.
    With so many posts, you need to increase memory or index the database – this can help your site work faster not only with our plugin.
    Don’t forget to make a backup!

    Thread Starter Marty

    (@bozzmedia)

    Not sure what you mean by indexing the database. The db is InnoDB format which doesn’t support repair or optimize, but I did recreate the tables.

    Still the same issues. This is one of the only plugins running on our dev site, and it only occurs when this plugin is activated.

    I have tested it with memory up to 1GB per process, it’s a 16GB VPS with plenty of resources and it still runs out of memory / critical error.

    Is there a way to reduce the # of posts the initial query is running for?

    I appreciate your help, thanks!

    Unfortunately, this is how the plugin works now. In the future, we will come up with something for optimization

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Too many resources / not working on large site’ is closed to new replies.