Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id C006663282E for ; Wed, 21 Jul 2010 09:42:19 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 71874-04 for ; Wed, 21 Jul 2010 12:42:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp-out.abv.bg (smtp-out.abv.bg [194.153.145.70]) by mail.postgresql.org (Postfix) with ESMTP id 4D92A631ADA for ; Wed, 21 Jul 2010 09:42:08 -0300 (ADT) Received: from mail71.abv.bg (mail71.ni.bg [192.168.151.33]) by smtp-out.abv.bg (Postfix) with ESMTP id 62F1050D972 for ; Wed, 21 Jul 2010 15:42:05 +0300 (EEST) DomainKey-Signature: a=rsa-sha1; s=smtp-out; d=abv.bg; c=simple; q=dns; b=Qe/4qZGyrSS3jIfIl5VfV766bzR35gxd0KPvoJiNE3/iXiegudKEjnO830+uwhewD d/DrgKz20/2/Sgb2mhVXQzeYg+iOli4tSflWx251Bg0IgQQyk9Ad+JvSjbi9Yq9oD5j hJRbCaNhHCaj43td9aIt/CvR2u3yovd+/LJ50dM= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=abv.bg; s=smtp-out; t=1279716125; bh=5EX5sPV+bOwDO+yxkMEDcmfj3cne8ZAj8f8QQ1Y5g24=; h=Date:From:To:Message-ID:Subject:MIME-Version:Content-Type:DKIM; b=lwdOYaDZVpe+ZJpNItF459sZe2HwD7i2MAbGt00goMFuDEC4hIsd9hqXwY2XF5/ed 220SbBr+K8eK0bzuwRBzJQwdx2NFmCd5MjAbxsq51SCfC7nYrKNWZt5v4xkWPF5QIiR Iz8myLaiUKrn20eXHOx0g51LOpZWqKRTd3fPjSc= Received: from mail71.abv.bg (localhost.localdomain [127.0.0.1]) by mail71.abv.bg (Postfix) with ESMTP id 247A74FB64 for ; Wed, 21 Jul 2010 15:42:04 +0300 (EEST) Date: Wed, 21 Jul 2010 15:42:04 +0300 (EEST) From: stanimir petrov To: pgsql-performance@postgresql.org Message-ID: <609756248.1423.1279716124148.JavaMail.apache@mail71.abv.bg> Subject: tune memory usage for master/slave nodes in cluster MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1421_1405703113.1279716124147" X-Priority: 3 X-Mailer: AbvMail 1.0 X-Originating-IP: 94.155.107.202 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.091 tagged_above=-10 required=5 tests=BAYES_50=0.8, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201007/301 X-Sequence-Number: 39690 ------=_Part_1421_1405703113.1279716124147 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Hi I need to configure for high performance and memory usage my postgres 8.4 clusters. Description: The database is partitioned in regions. Every region has master and slave db. The application write:read=1:50. At the moment i had delpoyed the app on 3 servers as follows: Node1: db master2, db slave1, pgpool2, slony-1 replication of master2 to slave2. Node2: db master3, db slave2, pgpool2, slony-1 replication of master3 to slave3. Node3: db master1, db slave3, pgpool2, slony-1 replication of master1 to slave1. There is apache server on every Node that serve php pages. Read queries are sent to its slave only (which is on the same server to prevent network traffic). No i must configure the memory parameters of the postgres for the master and for the slave, because the slave must use much memory and writes the replicated data fast and the master must be fast writing. Also how to configure the max_connections, now i set them to 250, but i think to decrease them to 200 bcause i have pgpool infront of every db server. The database is not so big right now, but it will grow fast. I expect to have 10^5 simultanious users at the end, but when this happens the hardware will be changed, may be and other things. Now the servers are dual core CPU 2.6 with 1.7 GB RAM and i standart disk. (the small instance from AWS) The slave (read-only) has shared_buffers = 128MB effective_cache_size = 1GB max_connections = 250 everything else is default The master(write-only) has default settings ----------------------------------------------------------------- Не бъди безразличен-попълни анкетата за Рак на гърдата http://utrezavseki.org/campaigns.html#anketa_utre_za_vseki ------=_Part_1421_1405703113.1279716124147 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable  Hi
I need to configure for high performance and memory usage my p= ostgres 8.4 clusters.

Description:
The database is partitioned in= regions. Every region has master and slave db. The application write:read= =3D1:50.
At the moment i had delpoyed the app on 3 servers as follows:Node1: db master2, db slave1, pgpool2, slony-1 replication of master2 to = slave2.
Node2: db master3, db slave2, pgpool2, slony-1 replication of ma= ster3 to slave3.
Node3: db master1, db slave3, pgpool2, slony-1 replicat= ion of master1 to slave1.

There is apache server on every Node that = serve php pages. Read queries are sent to its slave  only (which is on= the same server to prevent network traffic).
No i must configure the me= mory parameters of the postgres for the master and for the slave, because t= he slave must use much memory and writes the replicated data fast and the m= aster must be fast writing.
Also how to configure the max_connections, = now i set them to 250, but i think to decrease them to 200 bcause i have pg= pool infront of every db server.
The database is not so big right now, b= ut it will grow fast. I expect to have 10^5 simultanious users at the end, = but when this happens the hardware will be changed, may be and other things= .
Now the servers are dual core CPU 2.6 with 1.7 GB RAM and i standart d= isk. (the small instance from AWS)

The slave (read-only) has
shared_buffers =3D 12= 8MB
effective_cache_size =3D 1GB
max_connections = =3D 250
everything else is default
The master(write-only) has de= fault settings



-----------------------------------------------------------------=
=D0=9D=D0=B5 =D0=B1=D1=8A=D0=B4=D0=B8 =D0=B1=D0=B5=D0=B7=D1=80=D0=B0=D0=B7= =D0=BB=D0=B8=D1=87=D0=B5=D0=BD-=D0=BF=D0=BE=D0=BF=D1=8A=D0=BB=D0=BD=D0=B8 = =D0=B0=D0=BD=D0=BA=D0=B5=D1=82=D0=B0=D1=82=D0=B0 =D0=B7=D0=B0 =D0=A0=D0=B0= =D0=BA =D0=BD=D0=B0 =D0=B3=D1=8A=D1=80=D0=B4=D0=B0=D1=82=D0=B0 ------=_Part_1421_1405703113.1279716124147--