Title: WordPress Posting Slowdown
Last modified: April 24, 2023

---

# WordPress Posting Slowdown

 *  [nkir2023](https://wordpress.org/support/users/nkir2023/)
 * (@nkir2023)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/wordpress-posting-slowdown/)
 * Hello to All!
 * I have a Python script that generates an array of posts to publish on a WordPress
   site. Posts are stored in memory in a form of array in JSON format for uploading
   to the WordPress via the REST API using Python requests.post function.
 * First 300-400 posts work great and a posting speed is about several posts per
   second. Htop shows several mariadb instances working, memory is not overloaded
   and uses 1-2Gb from 12Gb total.
 * But after that everything starts to slow down dramatically. After a while only
   2 mariadb processes remain consuming about 90-100% of one CPU core jumping from
   one core to another. Other cores are almost free.
 * The speed of posting drops to 1-2 posts per 10-15 seconds and gradualy almost
   dies in time. But I need to record several thousands of posts so it is not acceptable.
   I did not tweak database settings much, so what I have im /etc/mysql/my.conf:
 * [mariadb]
   performance_schema=ONskip-name-resolve=1innodb_buffer_pool_size=2Ginnodb_log_file_size
   =512Mslow_query_log=1tmp_table_size=64Mmax_heap_table_size=64Mthread_handling
   =pool-of-threadsquery_cache_size=0
 * I have tried Redis, WP-Cache, WP-Optimize but it’s all for reading, they don’t
   work for writing.
 * Maybe someone could direct me where though to dig?
 * Thank you in advance!

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

 *  [Svetoslav Marinov](https://wordpress.org/support/users/lordspace/)
 * (@lordspace)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/wordpress-posting-slowdown/#post-16708364)
 * What if you execute wp-cli to create the commands.
   I had to do a WP user migration
   and tried several things. I ended up creating a script that directly loads wp-
   load.php and runs some WordPress functions. That was super fast!
 *  Thread Starter [nkir2023](https://wordpress.org/support/users/nkir2023/)
 * (@nkir2023)
 * [3 years ago](https://wordpress.org/support/topic/wordpress-posting-slowdown/#post-16731579)
 * Hello!
 * We have found the root cause of the problem. It is not MariaDB but WordPress 
   API loading new post. The issue is that we need to publish large amount of posts
   with the same title. There are some checks in API that use SELECT for the whole
   wp_posts table and while the number of posts encreases it runs more and more 
   slowly.
   So is there any way to avoid checks? I can see that if I publish posts
   as Drafts it works much quicker.

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

The topic ‘WordPress Posting Slowdown’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [nkir2023](https://wordpress.org/support/users/nkir2023/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/wordpress-posting-slowdown/#post-16731579)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
