Hello, I have a site which uses an auto draft post plugin and everytime its turned on it brings out the site numerous times. I need to prevent this from keep happening. The plugin is used on other sites and works normally. Its causing issue on one of the site. I will not give you access to my site unless you are an active user or have a good rep here. Thanks
Have you tried increasing the memory usage allotted to wp? This typically would go on line 39 of wp-config define('WP_MEMORY_LIMIT', '256M');
Increasing the memory is helping in similar cases, but you can write it almost everywhere in the file, the number of the line can vary and you can't say that exactly there is the place as you are not sure how his wp-config.php file looks like.
More Details on the Issue: The site publishes around 400 posts a day. But initially its saved in DRAFT and the plugin takes those Draft posts and publishes them in certain intervals. Soon as the plugin is turned on it starts the publishing process but randomly the site will show Error establishing a database connection. It does get the job done eventually, but due to server downtime it affects the site. The plugin does thru this process for about 5 hours and the site would be done for total of 1 hour throughout the 5 hour process. As mentioned before, I use this plugin on other sites and there is no issue there. Also - NOTE: the site it causes issue in has massive amount of published posts... inc
So, according to this, your process is working for one hour and sitting idle for four hours? Four hours of useless downtime is a lot. Why is your process idling for those four hours? Is there an infinite loop somewhere in the process?
Are you on Shared Hosting Server? You should find out the limit of concurrent MySQL connections? As your plugin is unable to establish database connections => the above limit could be the issue.
Yes your Hosting guys would be the best to contact to find out if the MySQL limit can be increased. Alternatively you could also check if you could optimize your plugin settings (# of posts to process per run and the cron frequency) to work within your available Server resources.
No it doesnt sit idle. The plugin publishes 3 draft post every 120 sec. When performing this task it brings the site down several times for 5-10min. But it gets the job done when its not down. Something is causing the site to go down and thats the solution im looking.
the log should give you valuable info on why the site goes down, based on what you said, "this particular site contains a lot of posts", there could be a problem with the way it queries the database to select the posts to publish
It seem that your current draft plugin need many resources either move to vps or get another plugin there are many plugins for specific job which may need less resources.
Well, i cant see your code but a good guess would be to optimize the queries, create indexes in the db if possible, worst case scenario is you will have to move your site to a better host. I could look at the plugin and check the queries, just drop me a pm