postgresql shmmax ubuntu

Posted on 2009-04-22
Last Modified: 2013-11-15
i was configuring ubuntu to use postgresql ,i got this error,

 * Restarting PostgreSQL 8.3 database server                                     * The PostgreSQL server failed to start. Please check the log output:
2009-04-23 16:13:10 EST LOG:  could not load root certificate file "root.crt": no SSL error reported
2009-04-23 16:13:10 EST DETAIL:  Will not verify client certificates.
2009-04-23 16:13:10 EST FATAL:  could not create shared memory segment: Invalid argument
2009-04-23 16:13:10 EST DETAIL:  Failed system call was shmget(key=5432001, size=140181504, 03600).
2009-04-23 16:13:10 EST HINT:  This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter.  You can either reduce the request size or reconfigure the kernel with larger SHMMAX.  To reduce the request size (currently 140181504 bytes), reduce PostgreSQL's shared_buffers parameter (currently 16384) and/or its max_connections parameter (currently 103).
      If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
      The PostgreSQL documentation contains more information about shared memory configuration.

any ideas?
Question by:klay8
    LVL 10

    Accepted Solution

    That means that you request more Shared memory for Postgres than is allowed by Ubuntu.
    Have a look here:

    Use sysctl to increase the value:

    sudo sysctl -w kernel.shmmax=256000000

    Open in new window

    LVL 10

    Expert Comment

    You can see your currently limit with the following:
    It must increase the value of shared_buffers in the Postgres-Config

    cat /proc/sys/kernel/shmmax 

    Open in new window

    LVL 16

    Expert Comment

    Wait. Ubuntu is an out-of-the-box distro. Is this the first time you try to start it?

    Author Comment

    yes first, time to start it
    LVL 61

    Expert Comment

    It is not first time you start it - 140MB or 103 sessions is not the default postgresql.conf

    LVL 16

    Expert Comment

    Anyway, uninstall it and reinstall and see if it comes again

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
    I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension ( This reminded me of questions tha…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now