Linux服务器不能分配内存,linux – PostgreSQL无法启动,因为它“无法分配内存”

我在Ubuntu 10.04上运行PostgreSQL 8.4.5.我运行一个EC2实例,其中有几个站点在nginx上运行.大多数这些站点都在Django上运行并连接到这个Postgres实例.

出于某种原因,今晚8点45分,Postgres下台了.我登录到机器,我看到此错误消息:

* Starting PostgreSQL 8.4 database server

* The PostgreSQL server failed to start. Please check the log output:

2011-04-17 04:46:49 UTC FATAL: could not create shared memory segment: Cannot allocate memory

2011-04-17 04:46:49 UTC DETAIL: Failed system call was shmget(key=5432001, size=16211968, 03600).

2011-04-17 04:46:49 UTC HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space. To reduce the request size (currently 16211968 bytes), reduce PostgreSQL's shared_buffers parameter (currently 1792) and/or its max_connections parameter (currently 53).

The PostgreSQL documentation contains more information about shared memory configuration.

...fail!

我做的第一件事是更改Linux共享内存分配.

sysctl -w kernel.shmmax=367108864>

sysctl -p /etc/sysctl.conf

那没有做到.然后我编辑了/etc/postgresql/8.4/main/postgresql.conf并降低了max_connections值.这有效…大约10分钟.

现在我得到了同样的错误,无论max_connections有多低.我需要将它设置为至少9(因为这是需要访问此Postgres服务器的Django项目的数量).

关于如何解决这个问题的任何想法?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值