简体   繁体   English

在两个不同的Wordpress数据库之间交换数据

[英]Exchanging Data between two different Wordpress databases

My wordpress website has two plugins that seems to be taking up a lot of memory. 我的wordpress网站上有两个似乎占用大量内存的插件。 It eventually times out after 30 seconds when I try to pull up data or do certain tasks. 当我尝试提取数据或执行某些任务时,它最终会在30秒后超时。

When one of the plugins are disabled, it performs a lot better. 当其中一个插件被禁用时,它的性能要好得多。 The problem is, these two plugins have to be activated because one is the payment gateway system WooCommerce. 问题是,必须激活这两个插件,因为一个是支付网关系统WooCommerce。 The other one is the learning management system LearnDash. 另一个是学习管理系统LearnDash。

I am having ongoing communications with the plugin developers as they are kind enough to look into the problem. 我正在与插件开发人员进行持续的沟通,因为他们足够友好地调查问题。

Meanwhile, I am trying to see if it is possible to set up two wordpress instances. 同时,我试图查看是否可以设置两个wordpress实例。 One at my main domain, and the other one at my sub domain. 一个在我的主域中,另一个在我的子域中。 And Hopefully, I can set up the main domain as a place where people can purchase the product, and the subdomain has the learning management system where people can study the product they purchased. 希望我可以将主域设置为人们可以购买产品的地方,而子域具有学习管理系统,人们可以在其中学习购买的产品。

So that would be two different wordpress databases. 因此,这将是两个不同的wordpress数据库。

I am trying to get a general idea of which direction I might wanna head to as I have the following questions: 由于存在以下问题,我试图大致了解我想去哪个方向:

1) Is it even possible that plugin from one wordpress can communicate with other wordpress database in sub-domain? 1)甚至一个wordpress的插件是否可以与子域中的另一个wordpress数据库通信?

2) Is it possible that a wordpress can have two databases and plugin runs from different database? 2)WordPress是否可能有两个数据库,并且插件可以从不同的数据库运行?

3) Is there a specific method to exactly diagnose how many plugins activate and know if certain tasks well successfully run without 30 seconds time out issue? 3)是否有一种确切的方法来准确诊断激活了多少个插件,并知道某些任务是否可以成功成功运行而没有30秒钟的超时问题?

You need to fix the underlying issues in the one WordPress site with the Ecommerce and LearnDash plugins, because 1) and 2) are huge wastes of time that will result in a buggy, unreliable system that will be difficult to maintain. 您需要使用Ecommerce和LearnDash插件在一个WordPress网站中解决基本问题,因为1)和2)浪费大量时间,这将导致存在问题的,不可靠的系统,难以维护。

3) look in your server logs for the PHP timeout and memory errors; 3)在服务器日志中查找PHP超时和内存错误; adjust PHP memory and time-out issues on your server. 调整PHP内存和服务器上的超时问题。

PHP timeout errors: PHP超时错误:

Set your PHP max_execution_time for 120 seconds in the php.ini file: 在php.ini文件中将您的PHP max_execution_time设置为120秒:

max_execution_time = 120

or in .htaccess for PHP5 或在.htaccess对于PHP5)

<IfModule mod_php5.c> php_value max_execution_time 120 </IfModule>

Memory: 记忆:

Set WordPress memory in wp-config.php: wp-config.php:设置WordPress内存wp-config.php:

Overall memory: 总内存:

define('WP_MEMORY_LIMIT', '128M');

Memory for admin: 管理员内存:

define('WP_MAX_MEMORY_LIMIT', '256M');

If you're on cheap shared hosting, find a better host. 如果您使用廉价的共享主机,请找到更好的主机。 Ecommerce and systems such as LearnDash are very database intensive and will not run on a cheap host, even with lots of memory and high PHP execution settings. 电子商务和系统(如LearnDash)占用大量数据库资源,即使具有大量内存和较高的PHP执行设置,也无法在廉价的主机上运行。 Having to give PHP more than 30 to 60 seconds max_execution_time means you are on a slow server. 必须给PHP超过30至60秒的max_execution_time意味着您的服务器运行缓慢。

If this is your own server, use one of many debug plugins to check MySQL query usage, slow queries, etc. https://wordpress.org/plugins/search.php?q=debug Adjust MySQL configurations as needed so MySQL can handle the loads of WordPress and the plugins. 如果这是您自己的服务器,请使用许多调试插件之一来检查MySQL查询的使用情况,查询速度慢等。https: //wordpress.org/plugins/search.php?q = debug根据需要调整MySQL配置,以便MySQL可以处理WordPress和插件的负载。 If this is not your own server, find a better host. 如果这不是您自己的服务器,请查找更好的主机。

And, as commented, try https://wordpress.org/plugins/p3-profiler/ to check resource usage by plugins. 并且,如所评论,尝试https://wordpress.org/plugins/p3-profiler/检查插件的资源使用情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM