[Pgcluster-general] load balance
Chahyeon Rhee
rchyeon at gmail.com
Wed Jun 4 17:30:03 UTC 2008
Hi! there,
I am still working on load balance.
I found some. If some can give more with this, please give me.
I just looked in the source level.
In my pglb.log:
Wed Jun 4 11:23:45 2008
PGRset_status_on_cluster_tbl():host:server1.***.***.*** p\
ort:5432 max:5 use:0 status1
Wed Jun 4 11:23:45 2008
PGRset_status_on_cluster_tbl():host:server2.***.***.*** p\
ort:5432 max:5 use:0 status1
Wed Jun 4 11:23:45 2008 init_pglb():Child_Tbl size is[7740]
Wed Jun 4 11:23:45 2008 before load_balance
Wed Jun 4 11:24:16 2008 PGRscan_cluster:2 ClusterDB can be used
Wed Jun 4 11:24:16 2008 PGRscan_cluster:server1.***.***.***
[5432],useFlag->1 max\
->5 use_num->0
Wed Jun 4 11:24:16 2008
PGRset_status_on_cluster_tbl():host:server1.***.***.*** p\
ort:5432 max:5 use:1 status2
Wed Jun 4 11:24:16 2008 before PGRdo_child
Wed Jun 4 11:24:16 2008 I am 17198
Wed Jun 4 11:24:16 2008 I am 17198 accept fd 6
Wed Jun 4 11:24:16 2008 Protocol Major: 1234 Minor: 5679 database: user:
Wed Jun 4 11:24:16 2008 PGRdo_child(): SSLRequest: sent N; retry startup
Wed Jun 4 11:24:16 2008 before return status_error_2
Wed Jun 4 11:24:16 2008 after PGRdo_child
This is related with the souce:
child.c
int
PGRdo_child(int use_pool)
{
/* SSL? */
if (sp->major == 1234 && sp->minor == 5679)
{
/* SSL not supported */
show_debug("%s: SSLRequest: sent N; retry startup",func);
if (ssl_request)
{
pool_close(frontend);
pool_free_startup_packet(sp);
PGRset_status_to_child_tbl(pid,TBL_FREE);
if (use_pool == USE_CONNECTION_POOL )
{
show_debug("before continue");
continue;
}
else
{
show_debug("before return status_error_1");
return STATUS_ERROR;
}
}
}
So, I tried what happened if continue like
child.c
int
PGRdo_child(int use_pool)
{
/* SSL? */
if (sp->major == 1234 && sp->minor == 5679)
{
/* SSL not supported */
show_debug("%s: SSLRequest: sent N; retry startup",func);
if (ssl_request)
{
pool_close(frontend);
pool_free_startup_packet(sp);
PGRset_status_to_child_tbl(pid,TBL_FREE);
//if (use_pool == USE_CONNECTION_POOL )
//{
// show_debug("before continue");
continue;
//}
//else
//{
// show_debug("before return status_error_1");
// return STATUS_ERROR;
//}
}
}
then load balance is connected and load balance can send request to server1
or server2. But load balance looks not working correctly.
I am thinking at this point.
If anybody can give some intuition, please give me.
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pgfoundry.org/pipermail/pgcluster-general/attachments/20080604/25cd7374/attachment.html
More information about the Pgcluster-general
mailing list