• Resolved cnxsoft

    (@cnxsoft)


    When I create a new post, it really takes a lot of time, around 30+ seconds, and a lot of memory: 300MB+ RAM. Query Monitor reports one slow query from Urvanov Syntax Highlighter:

    
    SELECT wp_posts.*
    FROM wp_posts
    WHERE 1=1
    AND wp_posts.post_type IN ('post', 'page', 'attachment')
    AND (wp_posts.post_status = 'publish'
    OR wp_posts.post_status = 'future'
    OR wp_posts.post_status = 'draft'
    OR wp_posts.post_status = 'pending'
    OR wp_posts.post_author = 1
    AND wp_posts.post_status = 'private')
    ORDER BY wp_posts.post_date DESC

    I have over 8,000 posts in my database, so I think it may be why it takes so long, and uses a lot of memory.

    After I save the new post, this is not called anymore, the page loads must faster, around 2 seconds, and the slow query is gone.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter cnxsoft

    (@cnxsoft)

    A small update just to confirm the bug. I temporary disabled Urvanov Syntax Highlighter before creating a new post, and the slow query is gone, memory usage is down to around 20 MB.

    That’s currently a small annoyance, but on some sites with even more posts, it may crash the server, or people may fail to create a new post if memory limits are reached. Right now, I have a 512MB memory limit for PHP configured.

    Thread Starter cnxsoft

    (@cnxsoft)

    I cannot understand why, but the problem has been resolved. Creating a new post does not take a lot of time, nor consumes a large amount of memory. Maybe a conflict with another plugin?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Slow query and high memory usage’ is closed to new replies.