[pgpool-hackers: 3710] discuss of pgpool enhancement

周建身 zhoujianshen at highgo.com
Mon Jul 13 18:55:50 JST 2020


Hello Usama and Hackers,

    ​I have tested the pgpool connection pool.And I think there are some parts need to be enhanced.

    When you set the parameter num_init_children = 32.only 32 child processes will be forked and waiting for the connection from client.Each child process can only receive one client connection,therefore, only 32 clients can connect to pgpool at the same time.The extra connections,before connection, can only wait for the previous connection to be disconnected.So,can we change the waiting connection structure of pgpool. When pgpool starts ,we can fork ten child processes to wait for the client to connect.When the child process receives the connection request, it creates a new child process to maintain the session connection.

    there is also another one which should be enhance is the connection pool.Now, for each connection, the child process can only receive one client connection. Therefore, the connection pool in the child process does not play a global reuse effect.And each connection will re-initialize the connection pool. Therefore we should implement a global connection pool to achieve the effect of back end reuse.However ,we should confirm how many connections the global connection pool should maintain.And also we should confirm that if the connection pool is full,how should we respond to the arrival of new connections.I can come up with two kind of solutions.

    The first one is waiting until the connection in the connection pool disconnected.and then receive the new connection.The second one,We should check the number of connection and  the last access time of the connection in connection pool.And we replace the connection which has the oldest access time in the connection pool to the new connection.or we periodic detection the access time of each connection,and throw away the connections whose access time exceed a certain value.then we can use the extra space in connection pool.

    ​In my opinion,these two aspects need to be enhanced.How about your opinion.And what do you think we need to do to enhance these two aspects.Any suggestions and comments are welcome.



Thanks
Best regards
Zhou Jianshen
zhoujianshen at highgo.com<mailto:zhoujianshen at highgo.com>​​




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20200713/d9e7ca0e/attachment.html>


More information about the pgpool-hackers mailing list