2023年10月5日

PostgreSQL: 如何调整PostgreSQL的Out of Memory Killer(OOM Killer)设置

当服务器/进程内存不足时,Linux有两种方法来处理,第一种是OS(Linux)崩溃,整个系统宕机;第二种是终止使系统耗尽内存的进程(应用程序)。第二种方法的最佳选择是终止进程,防止OS崩溃。简而言之,Out-Of-Memory Killer是负责终止应用程序以避免内核崩溃的进程,因为它只杀死应用程序并避免整个操作系统崩溃。让我们首先讨论一下OOM和如何工作以及如何控制它,然后我们将讨论OOM Killer如何决定杀死哪个应用程序。 Linux操作系统的主要任务之一是在进程请求内存分配时为其分配内存。在大多数情况下,进程/应用程序将向操作系统请求内存,但它不会使用所请求的所有内存。如果操作系统将内存分配给所有请求内存但不打算使用它的进程,它将很快耗尽内存——系统将崩溃。 为了处理这种情况,操作系统有一个特性,允许操作…
2023年9月29日

PostgreSQL: Linux/Ubuntu源码编译安装PostgreSQL报错,提示 configure: error: dtrace not found

1. 问题概述: Linux/Ubuntu源码编译安装PostgreSQL,执行 ./configure 报错: checking for dtrace... no configure: error: dtrace not found 2. 相关原因: 未安装 dtrace 包。 查看PostgreSQL官网,https://www.postgresql.org/docs/current/dynamic-trace.html#DYNAMIC-TRACE Currently, the DTrace utility is supported, which, at the time of this writing, is available on Solaris, macOS, FreeBSD, NetBSD, and Oracle Linux. The SystemTap project for Linux…
2023年9月29日

PostgreSQL: Linux/Ubuntu源码编译安装PostgreSQL报错,提示 configure: error: xxx library not found

1. 问题概述: Linux/Ubuntu源码编译安装PostgreSQL,执行 ./configure 报错: configure: error: readline library not found If you have readline already installed, see config.log for details on the failure. It is possible the compiler isn't looking in the proper directory. Use --without-readline to disable readline support. 2. 相关原因: 未安装 readline 开发包。 3. 解决办法: 检查系统是否安装 readline 包 $ sudo dpkg -l | grep readline 如果没有libreadline-dev,则需安装 $ su…
2023年9月28日

PostgreSQL: PostgreSQL 参考文档 / 示例数据库 / Quick Links

PostgreSQL 参考文档: PostgreSQL PostgreSQL 14.1 手册 http://www.postgres.cn/docs/14/index.html PostgreSQL 14.9 Documentation https://www.postgresql.org/docs/14/index.html PostgreSQL高可用测试系列之Patroni + etcd + HAProxy + Keepalived 离线部署 https://blog.csdn.net/u010692693/article/details/121123843 PostgreSQL数据库的安装与配置  https://www.cnblogs.com/dengyulinBlog/p/6424462.html PostgreSQL PostgreSQL 教程 P…