博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
wordpress 高并发_HyperDB的高可用性WordPress
阅读量:2504 次
发布时间:2019-05-11

本文共 6720 字,大约阅读时间需要 22 分钟。

wordpress 高并发

One of the reasons why I have always been so enamored with WordPress is because of the limitless possibilities it has. It seems like if you know PHP and how to leverage data and control it, you can do almost anything. A WordPress database can hold just about any type of data, which has made it even more useful with the added capability of custom post types and custom fields. You can save all sorts of data to a WordPress database.

我一直对WordPress如此着迷的原因之一是因为它具有无限的可能性。 好像您了解PHP以及如何利用数据和控制数据一样,您几乎可以做任何事情。 WordPress数据库几乎可以保存任何类型的数据,这通过添加自定义帖子类型和自定义字段的功能使其变得更加有用。 您可以将各种数据保存到WordPress数据库。

The problem arises when you collect too much data, which can bog down your servers. Imagine huge websites with thousands of members, storing all sorts of information. This could be anything from member profile data, such as names, locations, and bios, to product information for a business website. One of the challenges is the limitation of using a single database and a single server to handle all of this. What happens when your lone server fails? The whole site and it’s functionality comes tumbling down, until the server is restored to working order.

当您收集太多数据时,就会出现问题,这可能会使服务器瘫痪。 想象一下拥有数千名成员的庞大网站,其中存储了各种信息。 从会员个人资料数据(例如名称,位置和个人资料)到企业网站的产品信息,这可以是任何东西。 挑战之一是使用单个数据库和单个服务器来处理所有这些的限制。 当您的单机服务器发生故障时会发生什么? 整个站点及其功能都会崩溃,直到服务器恢复正常工作为止。

Along comes , a plugin for spreading your site’s load across several servers and databases.

随之而来,这是一个用于在多个服务器和数据库之间分散站点负载的插件。

HyperDB

HyperDB has its advantages, which we will discuss as we continue our exploration. Why would you want to use HyperDB for your WordPress install? Here are just a few features.

HyperDB有其优势,我们将在继续探索时进行讨论。 为什么要在您的WordPress安装中使用HyperDB? 这里只是一些功能。

分区 (Partitioning)

Just like you might partition a hard drive on your computer, you can partition, or separate your data and spread it across multiple servers. This saves resources and helps to spread the data across multiple databases and servers. Hyper DB will try the most optimal servers first, which is helpful.

就像您可以在计算机上对硬盘驱动器进行分区一样,您可以对数据进行分区或分离,然后将其分布在多个服务器上。 这样可以节省资源,并有助于在多个数据库和服务器之间分布数据。 Hyper DB将首先尝试最优化的服务器,这很有帮助。

Think of it like this. If you stepped on a nail, placing your entire body weight on that single nail, it would easily go through your foot. However, if you distributed your bodyweight over an entire bed of nails, you could lay across it without being pierced. Partitioning in HyperDB is similar to the same idea. Instead of one server or database carrying a heavy load, increasing the likelihood that it will crash, it is spread across multiple servers and databases, so it is distributed evenly.

这样想吧。 如果您踩指甲,将您的整个体重放在那只指甲上,那很容易穿过您的脚。 但是,如果将体重分配到整个指甲床上,则可以将其放在上面而不被刺穿。 HyperDB中的分区与相同的想法类似。 它不是由一台服务器或数据库来承担繁重的工作,而是增加了崩溃的可能性,而是将其分布在多个服务器和数据库中,从而使它均匀分布。

复写 (Replication)

Replication is where you have multiple copies of the same server. One is a master, while the others are called slaves. You can write to the master, but you can only read from the slave servers. This may be useful for instances where security is your top priority.

复制是您拥有同一服务器的多个副本的位置。 一个是主人,其他人称为奴隶。 您可以写入主服务器,但只能读取从服务器。 对于将安全放在首位的情况,这可能很有用。

It’s important to note that HyperDB does not provide replication services. You have to configure your servers that way on your own. Then, HyperDB can access them once you’ve set it up.

重要的是要注意,HyperDB不提供复制服务。 您必须以这种方式自行配置服务器。 然后,HyperDB可以在设置后访问它们。

故障转移 (Failover)

This is like a chain of databases and servers that act as fail safe fallback methods for each other. They all contain the same data, but if one fails, the next one will take over. If the 1st two fail, then the third one will take over. I could see this as being useful for an application that requires 100% uptime and 24/7 accessibility. If you had a site where people paid to be there, you wouldn’t want it to go down, costing you valuable revenue. You’d want to have a backup in place, ready to go if the 1st server goes down.

这就像一串数据库和服务器,彼此充当故障安全后备方法。 它们都包含相同的数据,但是如果其中一个失败,则下一个将接管。 如果前两个失败,那么第三个将接管。 我认为这对于需要100%正常运行时间和24/7可访问性的应用程序很有用。 如果您有一个供人们付费的网站,那么您就不会希望它掉下来,从而浪费您宝贵的收入。 您需要准备好一个备份,如果第一台服务器出现故障,请准备好备份。

Failover is something you have to set up beforehand. Once that option is set up, it will query the next available server. If you don’t have it set up, HyperDB will try a few more times on its own, but it will eventually give up, returning an error.

故障转移是您必须事先设置的。 设置该选项后,它将查询下一个可用服务器。 如果您没有设置它,HyperDB将自行尝试多次,但最终将放弃,并返回错误。

HyperDB真正引起人们关注的地方 (Where HyperDB Really Gets Interesting)

Big businesses could really benefit from using HyperDB to their advantage. Imagine the different types of businesses out there that rely on databases and servers to run. Think about the massive amount of storage that would be required for the servers of a nationwide, or even an international company. You aren’t limited to having your servers all in one location. You could configure them to work with remote servers in other physical locations.

大型企业可以真正受益于使用HyperDB的优势。 想象一下依赖数据库和服务器来运行的不同类型的企业。 考虑一下全国甚至国际公司的服务器所需的大量存储。 您不仅限于将所有服务器都放在一个位置。 您可以将它们配置为与其他物理位置的远程服务器一起使用。

可能的方案 (A Possible Scenario)

Let’s use a hosting company as an example. They don’t store football fields of servers in one location. Most bigger hosting companies have servers located at their main headquarters, but they could also have remote servers located clear across the country. Think about how useful that is, in terms of serving up data. As much as we’d like to think that data is instantaneous to any location, it would take data longer to load from a server in California if you were in New York, than if you had a server located on the East Coast.

让我们以托管公司为例。 他们不在一个位置存储服务器的足球场。 大多数大型托管公司的服务器均位于其主要总部,但它们也可能在全国各地都设有远程服务器。 考虑一下在提供数据方面有多么有用。 尽管我们想想数据在任何位置都是瞬时的,但如果您在纽约,则从加利福尼亚的服务器加载数据所需的时间要比在东海岸的服务器加载数据花费的时间更长。

HyperDB simply takes the limitation of one server and no configuration options for expansion, and blows the doors off. Who is stronger and will last longer: a lone body builder, or 50 nimble men of average build. Collectively, the group of men can share the work, making everything much more efficient.

HyperDB仅仅具有一台服务器的局限性,而没有扩展用的配置选项,这让企业大吃一惊。 谁会更强壮并会持续更长的时间:一个孤独的健美者,或50个平均身材的敏捷男人。 总的来说,这群人可以共享工作,使一切工作效率更高。

结论 (Conclusion)

HyperDB can be extremely useful for optimizing your own custom server configuration. Think of the performance you could get out of multiple servers, compared to just one. Flexibility, combined with these essential features makes HyperDB a WordPress plugin worth looking at.

HyperDB对于优化您自己的自定义服务器配置非常有用。 考虑一下您可以从多台服务器获得的性能,而不是一台。 灵活性以及这些基本功能使HyperDB成为值得关注的WordPress插件。

If you’re looking for more information on HyperDB, check out the official docs:

如果您正在寻找有关HyperDB的更多信息,请查看官方文档:

翻译自:

wordpress 高并发

转载地址:http://ukrgb.baihongyu.com/

你可能感兴趣的文章
LeetCode-Burst Balloons
查看>>
LeetCode-Bitwise AND of Numbers Range
查看>>
Windows Server 2012和2008中使用计划任务定时执行BAT批处理文件 定时备份mysql数据...
查看>>
费马小定理与GCD&LCM
查看>>
P1077 摆花
查看>>
zynq修改ramdisk文件系统
查看>>
C#测量程序运行时间及cpu使用时间
查看>>
并发编程
查看>>
我自己曾经经历的CMMI3认证通过关于软件测试的访谈【转载】
查看>>
C# 操作Excel ——Excel获取数据、时间、图片
查看>>
【Express系列】第3篇——接入mysql
查看>>
js 高亮显示关键字
查看>>
CPU工作原理简图
查看>>
进程互斥于同步
查看>>
小米公布2017二季度手机出货量:环比增长70%
查看>>
IntelliJ Idea 集成svn 和使用[转自网络]
查看>>
VS2013 密钥 – 所有版本
查看>>
缓冲一日
查看>>
apache常用配置文件讲解
查看>>
html设置透明度
查看>>