[Pgcluster-general] concept of load balance server
Chahyeon Rhee
rchyeon at gmail.com
Thu May 29 05:33:27 UTC 2008
Well, actually I am asking about the flow of load balancer action.
For example, the client will open my homepage and the hompage (index.php) is
written in php to connect postgresql.
And the index.php will use pg_connect(host=server1 dbname=... ) to connect
postgre database.
In this case, if server1 is down or have more load than server2 then does
that connection go to the server2 automatically by load balancer?
Or, Do I have to say explicitly
like
$dbconn = pg_connect(host=server1 dbname=...) or pg_connect(host=server2
dbname=...)
So, What I am asking is taht the only I have to do for load balancer is
setting pglb.conf ? Or is there anything else to do for that?
Thanks,
On 5/28/08, mitani at sraw.co.jp <mitani at sraw.co.jp> wrote:
>
> Hi,
>
> The load balncer has current session numbers of each cluster db.
> The maximum session number of each cluster db is defined in "pglb.conf".
> Then, load balancer consider the load as "(connected sessions)/(max
> sessions)".
> It is consider neither connecting times nor cpu load.
> It is using just number of sessions.
>
> About the pg_connect error.
> Can you let us know the debug messages of replication server.
> Probably, we can find something in the debug log.
>
> Regards,
> --------------
> At.Mitani
>
> -- original message --
> From: Chahyeon Rhee<rchyeon at gmail.com>
> To: <pgcluster-general at pgfoundry.org>
> Sent: Wed, 28 May 2008 17:03:31 -0600
> Subject: [Pgcluster-general] concept of load balance server
>
> >Hi!
> >I am setting up load balance and cluster db1 in server 1
> >and replicator and cluster db2 in server 2.
> >I just tested replication and restoration.
> >Now, I would like to test load balance. But, I am little bit confused.
> >What I am thinking is that I think if client request some then they will
> go
> >to some page in server 1.
> >Which is starting point. So I used pg_connect(host=server1 port=5433
> dbname=
> >... )
> >What I am thinking is if that connection go to load balance server in port
> >5433 then load balance server will determine which is lower load from
> >server1 and server 2. Server 1 and server 2 has port 5432. And the
> selected
> >database will be used for that service.
> >Is that right ?
> >If not, please give me any advice.
> >Also when I am doing like this, I am getting this error message *
> >Warning*: pg_connect()
> >[function.pg-connect<
> http://seo.gkmc.utah.edu/cha_test/pgcluster/function.pg-connect>]:
> >Unable to connect to PostgreSQL server: server closed the connection
> >unexpectedly This probably means the server terminated abnormally before
> or
> >while processing the request.
> >
> >If you know about this, please give me some help.
> >
> >Thanks,
> >
> >_______________________________________________
> >Pgcluster-general mailing list
> >Pgcluster-general at pgfoundry.org
> >http://pgfoundry.org/mailman/listinfo/pgcluster-general
> >
>
> _______________________________________________
> Pgcluster-general mailing list
> Pgcluster-general at pgfoundry.org
> http://pgfoundry.org/mailman/listinfo/pgcluster-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pgfoundry.org/pipermail/pgcluster-general/attachments/20080528/70861f9d/attachment-0001.html
More information about the Pgcluster-general
mailing list