Support » Fixing WordPress » Very long time of post update (wp-admin/post.php)

  • Hello,
    since some time post updating time is very long (even 50 seconds (normal time before was 1-2 seconds)). I’ve deactivated all plugins – it didn’t change anything. I’ve reinstalled WordPress via “re-install now” button – didn’t work. I’ve checked it using Query Monitor plugin, but it doesn’t monitor POST method (only GET).
    I have 19500 posts and 12000 tags (I’ve started to delete all tags – I don’t really need them).
    Loading time of GET wp-admin/post.php?post=X&action=edit&message=1 is normal – 1-2 seconds, sometimes more. PHP version is 7.3 and WordPress 5.3.2.
    Sometimes wp-admin/post.php returns Internal Server Error.
    I’m using default WordPress theme – twenty sixteen. I’m updating posts very often – like once per 2 seconds using application (bot).

    Can you tell me how I can check what is the reason of that?
    Cheers

    • This topic was modified 1 year, 4 months ago by r3crac.
    • This topic was modified 1 year, 4 months ago by r3crac.
    • This topic was modified 1 year, 4 months ago by r3crac.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter r3crac

    (@r3crac)

    In public_html/error_log file there’re a lot of errors like:
    WordPress database error User 'x' has exceeded the 'max_questions' resource (current value: 1) for query SELECT x_posts (...)

    I’ve contacted with hosting support and they said that they have set max_questions to unlimited.

    There are also these errors:

    [24-Mar-2020 08:15:02 UTC] PHP Warning:  mysqli_query(): Error reading result set's header in /home4/x/public_html/wp-includes/wp-db.php on line 2030
    [24-Mar-2020 08:15:02 UTC] PHP Warning:  mysqli_query(): MySQL server has gone away in /home4/x/public_html/wp-includes/wp-db.php on line 2030
    • This reply was modified 1 year, 4 months ago by r3crac.
    • This reply was modified 1 year, 4 months ago by r3crac.
    Moderator Steve Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    This sounds like a config or capacity problem with your MySQL server that would have to be addressed by your host. First, however, try (1) removing unncessary content from your database with a plugin like https://wordpress.org/plugins/wp-sweep/, then optimize the database via PHPMYADMIN following https://www.a2hosting.com/kb/cpanel/cpanel-database-features/optimizing-and-repairing-mysql-databases-with-phpmyadmin

    Thread Starter r3crac

    (@r3crac)

    1. WP Sweep didn’t change anything (I’ve selected everything, even database sweep).
    2. PHPMyAdmin throws “lost connection to mysql server during query” after clicking “Optimize table” (it took about 1 minute to throw this error) on all selected tables (there are 42 tables. The biggest tables:
    – InnoDB named 75b_posts (177.2 MB),
    – MyISAM 75b_yoast_seo_links (14.8 MB),
    – MyISAM 75b_postmeta (11.5 MB) ),
    – MyISAM 75b_term_relationships (9.2 MB).

    This is how it looks like (wp-admin/post.php file). Black color is POST and Blue GET. Sometimes Internal Server Error appears on both GET and POST.
    https://i.imgur.com/4OcASEr.png

    • This reply was modified 1 year, 4 months ago by r3crac.
    • This reply was modified 1 year, 4 months ago by r3crac.
    • This reply was modified 1 year, 4 months ago by r3crac.
    • This reply was modified 1 year, 4 months ago by r3crac.
    • This reply was modified 1 year, 4 months ago by r3crac.
    Moderator Steve Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    Item number 2 suggests that your MySQL server is the issue, not WordPress. Please contact your host.

    Thread Starter r3crac

    (@r3crac)

    I’ve already contacted with the host (BlueHost). They can’t find any issues.

    Thread Starter r3crac

    (@r3crac)

    I think I found why it’s so slow. I’ve had too many tags (14k). I’ve deleted 12k and now it’s a way faster (post.php takes less than 5 seconds, sometimes 2 seconds). I will delete all of them (using WP Sweep).
    Do you know plugins or manual ways of cleaning useless post meta, terms etc.? I don’t think WP Sweep is cleaning everything. I found that I can delete “_edit_lock”, “_edit_last” from database (I did it – 38k records!). I’ve disabled revisions, auto save. What else can I do?

    • This reply was modified 1 year, 4 months ago by r3crac.
    Thread Starter r3crac

    (@r3crac)

    Well, that was not issue.
    I’ve checked searching with Query Monitor plugin. Here is SQL Query ( https://website.com/?s=viofo ) that is super slow (19 seconds this time):

    SELECT SQL_CALC_FOUND_ROWS 75b_posts.ID
    FROM 75b_posts
    WHERE 1=1
    AND (((75b_posts.post_title LIKE '%viofo%')
    OR (75b_posts.post_excerpt LIKE '%viofo%')
    OR (75b_posts.post_content LIKE '%viofo%')))
    AND 75b_posts.post_type IN ('post', 'page', 'attachment')
    AND (75b_posts.post_status = 'publish'
    OR 75b_posts.post_author = 1
    AND 75b_posts.post_status = 'private')
    ORDER BY 75b_posts.post_title LIKE '%viofo%' DESC, 75b_posts.post_date DESC
    LIMIT 0, 10

    This is the caller:

    WP_Query->get_posts()
    Main Query

    Screenshot:
    https://i.imgur.com/FWCyFnG.png

    Here is another query, but it’s faster (1 second):

    SELECT 75b_posts.*
    FROM 75b_posts
    WHERE 1=1
    AND 75b_posts.ID IN (19327,13600,19324,330444,283013,330413,587881,610705,628185,628183,639260,1150866,1280541,1380663,1536242,2141749,4102953,4881216,4885577,4882266,4881347,4882005,4883739,4883740,5010699,5081700,5081697,5224840,5623788,5692541,5777727,5804331,5834759,5896805,6030583,6660368,6592214,6660365)
    AND 75b_posts.post_type = 'post'
    AND ((75b_posts.post_status = 'publish'))
    ORDER BY 75b_posts.post_date DESC

    Screenshot:
    https://i.imgur.com/E8DHfHz.png

    Do you have any idea what to do to improve speed of searching and posting/updating?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Very long time of post update (wp-admin/post.php)’ is closed to new replies.