将一个 postgres 服务器扩展到多个服务器
我们的 postgres 服务器即将达到其容量,我们正在考虑添加第二个数据库服务器。 是否有任何特别适合 postgres 设置的扩展解决方案?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您正在考虑一组有限的选择,很大程度上取决于您的具体要求(读写比率以及您的应用程序对偶尔不一致读取的容忍度[同步与异步复制?主从与多主) ?],表的连接强度[集群]等)
更新
自最初的答案以来已经过去了六年多。 请参阅高可用性、负载平衡和复制章节< /a> 在 PostgreSQL 文档中获取可用的最新解决方案。
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 chapter in the PostgreSQL documentation for the latest solutions available to you.
你检查过你的瓶颈是什么吗? 哪些查询会让你的服务器努力工作? 也许可以调整得更好。
如果调整没有帮助,那么升级服务器通常比设置复制要容易得多。 在 RAID1 或 RAID10 中添加一些磁盘、添加一些 RAM、更多内核和更快的处理器。 具有电池支持缓存的良好 RAID 控制器也会产生很大的影响。
复制 ID 有利于高可用性,但如果您遇到性能问题,通常更大的服务器会更具成本效益。
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.
Replication id good for high availability but often a bigger server will be more cost effective if you have performance problems.
Postgres Advanced Server 和Continentt Tungsten 也值得考虑作为企业级解决方案。
There's Postgres Advanced Server, and Continuent Tungsten are also worth looking into for an enterprise class solution.