Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLw2z-0002dI-5c for pgsql-performance@postgresql.org; Wed, 10 Oct 2012 13:10:01 +0000 Received: from smtp2.peak6.com ([38.98.137.9]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLw2w-0005kh-TS for pgsql-performance@postgresql.org; Wed, 10 Oct 2012 13:09:59 +0000 X-AuditID: 0a02cb1e-b7f4d6d0000008be-5c-507572aa444e Message-ID: <507573A4.1090605@optionshouse.com> Date: Wed, 10 Oct 2012 08:09:56 -0500 From: Shaun Thomas Reply-To: Organization: Peak6 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 MIME-Version: 1.0 To: =?UTF-8?B?U3RyYWhpbmphIEt1c3R1ZGnEhw==?= CC: Subject: Re: shared_buffers/effective_cache_size on 96GB server References: In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Length: 2339 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.10.201.64] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupileLIzCtJLcpLzFFi42LhSuEV011VVBpgsG6WgMX1meeYLQ49uMDm wORxd4Wsx4V909gDmKIaGG0S8/LySxJLUhVSUouTbZX8C0oy8/OKPfJLi1MVXDKLk3MSM3NT i5QUMlNslcyVFApyEpNTc1PzSmyVEgsKUvNSlOy4FDCADVBZZp5Cal5yfkpmXrqtkmewv66F hamlrqGSXTwySOhkyehZcY69oFOwYurZc2wNjIt5uxg5OSQETCSuHfvJDmGLSVy4t56ti5GD g1dAX+L9J2YQk0VAVWL9XC6QCjYBXYlJ/SvYQGwhARWJvrM3mEBsfgFhiX0fmphBbFGBMIl3 v46ygti8AoISJ2c+YQGxRQRcJR4/6gfrZRZQk5j7cBJYjbCAp8TKQ1+hZgZIfPrdBxbnFAiU OLT4KgtEvYXE4jcH2SFseYnmrbOZIepVJVY0T2SDuF5B4v+Vd0wTGIVmIVk9C0n7LCTtCxiZ VzGKF5clJmdkmhUU55YUGOoVpCZmm+nlpZZsYgTFLNNpuR2MKy4oHmIU4GBU4uE1KCkJEGJN LCuuzD3EKMHBrCTCa+pTGiDEm5JYWZValB9fVJqTWnyIMRkYZBOZpUST84HpJK8k3tDY0NLU 0sTM0tzY2IA0YSVxXoU+pQAhgXRg0slOTS1ILYLZwsTBKdXA6Fjd+CvP9UwSp1nQ/AYLJwNT TvULvf4ilice6x9ZYDz3jkGB4ZU8qYIlWWuLuc6oly+Unlw5o81vK6N3WXyhze+JZh3iN/pr b4aKrZ/+8FGVEvPco8k/lflK07Wmul5Lf1K5/dVmh//d91m0txx5JFdXdGtny7Nin8L/F5I2 Nrcl1Z5c1K2sxFKckWioxVxUnAgAkZ5aAR0DAAA= X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201210/110 X-Sequence-Number: 48069 On 10/10/2012 02:12 AM, Strahinja Kustudi=C4=87 wrote: > total used free shared buffers cached > Mem: 96730 96418 311 0 71 93120 Wow, look at all that RAM. Something nobody has mentioned yet, you'll want to set some additional kernel parameters for this, to avoid getting occasional IO storms caused by dirty memory flushes. vm.dirty_background_ratio =3D 1 vm.dirty_ratio =3D 5 Again, these would go in sysctl.conf, or /etc/sysctl.d/10-dbserver.conf or something. If you have a newer kernel, look into vm.dirty_background_bytes, and vm.dirty_bytes. The why of this is brought up occasionally here, but it comes down to your vast amount of memory. The defaults for even late Linux kernels is 5% for dirty_background_ratio, and 10% for dirty_ratio. So if you multiply it out, the kernel will allow about 4.8GB of dirty memory before attempting to flush it to disk. If that number reaches 9.6, the system goes synchronous, and no other disk writes can take place until *all 9.6GB* is flushed. Even with a fast disk subsystem, that's a pretty big gulp. The idea here is to keep it writing in the background by setting a low limit, so it never reaches a critical mass that causes it to snowball into the more dangerous upper limit. If you have a newer kernel, the ability to set "bytes" is a much more granular knob that can be used to match RAID buffer sizes. You'll probably want to experiment with this a bit before committing to a setting. > So it did a little swapping, but only minor, still I should probably > decrease shared_buffers so there is no swapping at all. Don't worry about that amount of swapping. As others have said here, you can reduce that to 0, and even then, the OS will still swap something occasionally. It's really just a hint to the kernel how much swapping you want to go on, and it's free to ignore it in cases where it knows some data won't be accessed after initialization or something, so it swaps it out anyway. -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | Chicago IL, 60604 312-444-8534 sthomas@optionshouse.com ______________________________________________ See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email