[pgpool-general: 3984] Re: Possible connection leak
Derek
derek_kouch at yahoo.com.au
Tue Aug 18 13:01:01 JST 2015
I thought since it is in the cache, pgpool would reuse, rather than create a new process. I guess it doesn't matter, it's the same result in the end.
Kind regards,
Derek.
> On 18 Aug 2015, at 1:30 pm, Tatsuo Ishii <ishii at postgresql.org> wrote:
>
> Why do you think it's a problem?
>
> As I said, reaching to the num_init_children limit itself is not a
> problem as far as there's "Connected" = 0 process exists.
>
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp
>
>> When I switch back to the old database using the "\c", it creates a new process, rather than reuse the existing old one.
>>
>> Kind regards,
>> Derek.
>>
>>> On 18 Aug 2015, at 12:59 pm, Tatsuo Ishii <ishii at postgresql.org> wrote:
>>>
>>> That's no problem. Because the old one ("Connected" = 0) can accept
>>> new connection. As long as there are process which have ("Connected" =
>>> 0), pgpool-II happily accepts new connections.
>>>
>>> You can verify it by setting num_init_children = 2 and do:
>>>
>>> psql db1
>>> \c db2
>>> \c db1
>>> \c db2
>>> :
>>> :
>>>
>>> Best regards,
>>> --
>>> Tatsuo Ishii
>>> SRA OSS, Inc. Japan
>>> English: http://www.sraoss.co.jp/index_en.php
>>> Japanese:http://www.sraoss.co.jp
>>>
>>>> The old one has a value of 0. But remains in the list until the child life time is reached.
>>>>
>>>> Kind regards,
>>>> Derek.
>>>>
>>>>> On 18 Aug 2015, at 12:46 pm, Tatsuo Ishii <ishii at postgresql.org> wrote:
>>>>>
>>>>> Does not reporduce here. Are sure that "Connected" field is 1 for both
>>>>> the new and old database?
>>>>>
>>>>> Database : test2
>>>>> Username : t-ishii
>>>>> Start time : 2015-08-18 11:40:05
>>>>> Creation time: 2015-08-18 11:44:17
>>>>> Major : 3
>>>>> Minor : 0
>>>>> Counter : 1
>>>>> Backend PID : 6564
>>>>> Connected : 1
>>>>> PID : 6534
>>>>> Backend ID : 0
>>>>>
>>>>> Best regards,
>>>>> --
>>>>> Tatsuo Ishii
>>>>> SRA OSS, Inc. Japan
>>>>> English: http://www.sraoss.co.jp/index_en.php
>>>>> Japanese:http://www.sraoss.co.jp
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Psql to pgpool.
>>>>>>
>>>>>> After logging into the Postgres database, then switch to another database, it would have 2 processes according to pcp_proc_info.
>>>>>>
>>>>>>
>>>>>> Kind regards,
>>>>>> Derek.
>>>>>>
>>>>>> On 18 Aug 2015, at 11:59 am, Tatsuo Ishii <ishii at postgresql.org> wrote:
>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I'm current running pgpool-II 3.4.3-1 using pgpoolAdmin 3.4.1 on Rhel7.1.
>>>>>>>>
>>>>>>>> When I connect using psql to database1 via the virtual ip, then later switch over to another database2 using the "\c". Then switch back to database1. Pgpool creates 3 connections, which I can see in pgpoolAdmin->status->processes.
>>>>>>>>
>>>>>>>> If I continue to switch between the two databases, it will continue to increase the number of pgpool connections via the virtual ip. Eventually, these connections timeout when it reaches the child_life_time value or if it reaches the num_init_children limit, it will hang until a connection is available.
>>>>>>>
>>>>>>> I don't know when you say "the number of pgpool connections", these
>>>>>>> are from client (psql) to pgpool or pgpool to PostgreSQL. Because the
>>>>>>> former will not increase as long as the number of psql you are using,
>>>>>>> I assume you are referring to connections from pgpool to
>>>>>>> PostgreSQL.
>>>>>>>
>>>>>>> The number could increase until num_init_children reaches. However
>>>>>>> some of process are expected to accept connections from clients. You
>>>>>>> could verify it by using "show pool_nodes". "pool_connected" column
>>>>>>> indicates that the process is ready to accept connections from clients
>>>>>>> (in this case 0).
>>>>>>>
>>>>>>> Please remeber, however, that psql keeps old connection until \c
>>>>>>> succeeds. For example, if num_init_children = 1, you are never able to
>>>>>>> use \c.
>>>>>>>
>>>>>>>> I have the connection_cache on.
>>>>>>>>
>>>>>>>> Is there something that I need to set?
>>>>>>>
>>>>>>> You might want to set client_idle_limit.
>>>>>>>
>>>>>>> Best regards,
>>>>>>> --
>>>>>>> Tatsuo Ishii
>>>>>>> SRA OSS, Inc. Japan
>>>>>>> English: http://www.sraoss.co.jp/index_en.php
>>>>>>> Japanese:http://www.sraoss.co.jp
More information about the pgpool-general
mailing list