postgresql 将 postgres 服务器扩展到多个服务器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/570699/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Scaling a postgres server to multiple servers
提问by Oliver Kiel
Our postgres server is about hitting its capacity and we're looking into adding a second database server. Are there any scaling solutions that are particularly good for a postgres setup?
我们的 postgres 服务器即将达到其容量,我们正在考虑添加第二个数据库服务器。有没有特别适合 postgres 设置的缩放解决方案?
回答by vladr
You are looking at a limited set of choices, very dependent on what your specific requirements are (read-to-write ratios and how tolerant your application is of occasional inconsistent reads [synchronous vs. asynchronous replication? master-slave vs. multi-master?], how strongly connected your tables are [clustering], etc.)
您正在查看一组有限的选择,这非常取决于您的具体要求(读写比率以及您的应用程序对偶尔不一致读取的容忍度 [同步与异步复制?主从与多主?],您的表的连接强度 [聚类] 等)
UPDATE
更新
Over six years have elapsed since the original answer. Please refer to the High Availability, Load Balancing, and Replication chapterin the PostgreSQL documentation for the latest solutions available to you.
自最初的答案以来已经过去了六年多。有关可用的最新解决方案,请参阅PostgreSQL 文档中的高可用性、负载平衡和复制章节。
回答by Tometzky
Did you check what is your bottleneck? What are the queries that make your server work hard? Maybe it can be tuned better.
你有没有检查你的瓶颈是什么?哪些查询使您的服务器努力工作?也许它可以更好地调整。
If tuning will not help it is often much easier to upgrade a server than to set replication. Adding some disks in RAID1 or RAID10, adding some RAM, more cores and faster processor. A good RAID controller with battery backed cache would make a big difference too.
如果调整无济于事,升级服务器通常比设置复制要容易得多。在 RAID1 或 RAID10 中添加一些磁盘,添加一些 RAM、更多内核和更快的处理器。带有电池备份缓存的良好 RAID 控制器也会产生很大的不同。
Replication id good for high availability but often a bigger server will be more cost effective if you have performance problems.
复制 id 有利于高可用性,但如果您遇到性能问题,通常更大的服务器将更具成本效益。
回答by Mr Shoubs
There's Postgres Advanced Server, and Continuent Tungsten are also worth looking into for an enterprise class solution.
Postgres Advanced Server 和Continent Tungsten 也是值得研究的企业级解决方案。