Thread: mod_auth_pgsql 2.0.1 don't close the backend connection ?
Hello, I use mod_auth_pgsql 2.0.1 with PostgreSQL 7.3.2 and Apache 2.0.47. It seems like that mod_auth_pgsql don't close the connection with the Postmaster, so after a few moments I get the famous "Non-superuser connection limit exceeded" error message. The max_connections value is 256 and there's only 5 users at the same time on this server (Intranet server). Is it a bug in the mod_auth_pgsql that don't close the connection or is it a setup somewhere ? Thanks in advance for your help ! ------------------------------------- Bruno BAGUETTE - pgsql-ml@baguette.net
On Wed, 24 Sep 2003, Bruno BAGUETTE wrote: > Hello, > > I use mod_auth_pgsql 2.0.1 with PostgreSQL 7.3.2 and Apache 2.0.47. > > It seems like that mod_auth_pgsql don't close the connection with the > Postmaster, so after a few moments I get the famous "Non-superuser > connection limit exceeded" error message. > > The max_connections value is 256 and there's only 5 users at the same > time on this server (Intranet server). > > Is it a bug in the mod_auth_pgsql that don't close the connection or is > it a setup somewhere ? > Yes, the mod_auth_pgsql series for Apache 2 is broken as you describe. It does not release the connection, but the change is intentional. Looking at the Changelog I see: - now we reuse database connection, 2x speedup !! Perhaps this is a good thing with different MPMs, but the standard prefork module can exhaust the available connections quite quickly as you describe. Here is a patch for mod_auth_pgsql 2.0.1 that reverts it to the previous behavior of a new connection per authentication. I have added the maintainer to the cc: list, perhaps he has some input? Kris Jurka
Attachment
>>>>> "KJ" == Kris Jurka <books@ejurka.com> writes: >> Is it a bug in the mod_auth_pgsql that don't close the connection or is >> it a setup somewhere ? >> KJ> Yes, the mod_auth_pgsql series for Apache 2 is broken as you describe. It KJ> does not release the connection, but the change is intentional. Looking KJ> at the Changelog I see: Is not that the whole point of a child exit handler in apache? when each child exits, it calls a handler in each module that registers one so that it can do whatever cleanup it needs, such as closing the database handle. This facility was even available in apache 1.x. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D. Khera Communications, Inc. Internet: khera@kciLink.com Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
On Wednesday 01 October 2003 15:17, Vivek Khera wrote: > >>>>> "KJ" == Kris Jurka <books@ejurka.com> writes: > >> > >> Is it a bug in the mod_auth_pgsql that don't close the connection or is > >> it a setup somewhere ? > > KJ> Yes, the mod_auth_pgsql series for Apache 2 is broken as you describe. > It KJ> does not release the connection, but the change is intentional. > Looking KJ> at the Changelog I see: > > Is not that the whole point of a child exit handler in apache? when > each child exits, it calls a handler in each module that registers one > so that it can do whatever cleanup it needs, such as closing the > database handle. This facility was even available in apache 1.x. I think the problem is that Apache is pre-forking a batch of child processes that sit there using up all his connections. -- Richard Huxton Archonet Ltd
> Yes, the mod_auth_pgsql series for Apache 2 is broken as you > describe. It does not release the connection, but the change > is intentional. Looking at the Changelog I see: > > - now we reuse database connection, 2x speedup !! > > Perhaps this is a good thing with different MPMs, but the > standard prefork module can exhaust the available connections > quite quickly as you describe. Here is a patch for > mod_auth_pgsql 2.0.1 that reverts it to the previous behavior > of a new connection per authentication. I'm getting many errors when I do the make on the patched files. Is there other people that have compiled successfully the patched mod_auth_pgsql 2.0.1 ? I've attached to this email the error log. Do you have the same errors than me or do I have missed something ? > I have added the maintainer to the cc: list, perhaps he has > some input? I don't know, I've written to the maintainer but until now I never received any answer from him. Is there a CVS somewhere with that project ? Regards, --------------------------------------- Bruno BAGUETTE - pgsql-ml@baguette.net
Attachment
On Fri, 3 Oct 2003, Bruno BAGUETTE wrote: > I'm getting many errors when I do the make on the patched files. Is > there other people that have compiled successfully the patched > mod_auth_pgsql 2.0.1 ? > > I've attached to this email the error log. Do you have the same errors > than me or do I have missed something ? It cannot find the necessary pg header files. If you haven't installed them you need to do so. If you've installed them someplace other than /usr/local/pgsql/include you need to adjust the Makefile to reflect that. > I don't know, I've written to the maintainer but until now I never > received any answer from him. Is there a CVS somewhere with that project Not that I know of. Kris Jurka
> It cannot find the necessary pg header files. If you haven't > installed them you need to do so. If you've installed them > someplace other than /usr/local/pgsql/include you need to > adjust the Makefile to reflect that. You were right, now the compilation is OK :-) But, now, when I try to access to a mod_auth_pgsql protected directory, Apache 2.0.47 have a segmentation fault errorr : Here's an extract of the error log : [Sun Oct 05 21:33:49 2003] [notice] child pid 2553 exit signal Segmentation fault (11) [Sun Oct 05 21:33:49 2003] [notice] child pid 2552 exit signal Segmentation fault (11) [Sun Oct 05 21:33:51 2003] [notice] child pid 2554 exit signal Segmentation fault (11) [Sun Oct 05 21:33:52 2003] [notice] child pid 2556 exit signal Segmentation fault (11) [Sun Oct 05 21:33:52 2003] [notice] child pid 2555 exit signal Segmentation fault (11) [Sun Oct 05 21:33:53 2003] [notice] SIGHUP received. Attempting to restart [Sun Oct 05 21:33:53 2003] [notice] seg fault or similar nasty error detected in the parent process If I do an apachectl start and retry I have the same error... :-( Any idea to fix that ? Do you want me to recompile it with debug options ? (If that can help, I will do) > > I don't know, I've written to the maintainer but until now I never > > received any answer from him. Is there a CVS somewhere with that > > project > > Not that I know of. Do you think that the mod_auth_pgsql module is still maintained ? We can wait one week (maybe Giuseppe Tanzilli in on vacations) before re-talking about it. However I am asking myself some questions because this bug is so big (the mod_auth_pgsql for Apache2 is broken) and the latest mod_auth_pgsql is seven months old. Either that project is maintained or not, a CVS could be usefull to allow multiple people submitting patches and documentation improvements for the mod_auth_postgresql module. I would be interested to improve the documentation of this module in order to make easier for people to use that module (and, in the same time, promoting PostgreSQL). Regards, --------------------------------------- Bruno BAGUETTE - pgsql-ml@baguette.net
Hello, I'm working on a new release to fix this, the connection reuse logic will be different and will be off by default. Hope to release something in the evening. bye, Giuseppe Bruno BAGUETTE Scrive: >> It cannot find the necessary pg header files. If you haven't >> installed them you need to do so. If you've installed them >> someplace other than /usr/local/pgsql/include you need to >> adjust the Makefile to reflect that. > > You were right, now the compilation is OK :-) > > But, now, when I try to access to a mod_auth_pgsql protected directory, > Apache 2.0.47 have a segmentation fault errorr : > > Here's an extract of the error log : > > [Sun Oct 05 21:33:49 2003] [notice] child pid 2553 exit signal > Segmentation fault (11) > [Sun Oct 05 21:33:49 2003] [notice] child pid 2552 exit signal > Segmentation fault (11) > [Sun Oct 05 21:33:51 2003] [notice] child pid 2554 exit signal > Segmentation fault (11) > [Sun Oct 05 21:33:52 2003] [notice] child pid 2556 exit signal > Segmentation fault (11) > [Sun Oct 05 21:33:52 2003] [notice] child pid 2555 exit signal > Segmentation fault (11) > [Sun Oct 05 21:33:53 2003] [notice] SIGHUP received. Attempting to > restart > [Sun Oct 05 21:33:53 2003] [notice] seg fault or similar nasty error > detected in the parent process > > If I do an apachectl start and retry I have the same error... :-( > > Any idea to fix that ? Do you want me to recompile it with debug options > ? (If that can help, I will do) > >> > I don't know, I've written to the maintainer but until now I never >> > received any answer from him. Is there a CVS somewhere with that >> > project >> >> Not that I know of. > > Do you think that the mod_auth_pgsql module is still maintained ? We can > wait one week (maybe Giuseppe Tanzilli in on vacations) before > re-talking about it. However I am asking myself some questions because > this bug is so big (the mod_auth_pgsql for Apache2 is broken) and the > latest mod_auth_pgsql is seven months old. > > Either that project is maintained or not, a CVS could be usefull to > allow multiple people submitting patches and documentation improvements > for the mod_auth_postgresql module. I would be interested to improve the > documentation of this module in order to make easier for people to use > that module (and, in the same time, promoting PostgreSQL). > > Regards, > > --------------------------------------- > Bruno BAGUETTE - pgsql-ml@baguette.net > > > ------------------------------------- Giuseppe Tanzilli info@giuseppetanzilli.it
Hello, just published 2.0.2b1, it was on the way from some time. Please test it, feel free to send patches. Bruno BAGUETTE Scrive: >> It cannot find the necessary pg header files. If you haven't >> installed them you need to do so. If you've installed them >> someplace other than /usr/local/pgsql/include you need to >> adjust the Makefile to reflect that. > > You were right, now the compilation is OK :-) > > But, now, when I try to access to a mod_auth_pgsql protected directory, > Apache 2.0.47 have a segmentation fault errorr : > > Here's an extract of the error log : > > [Sun Oct 05 21:33:49 2003] [notice] child pid 2553 exit signal > Segmentation fault (11) > [Sun Oct 05 21:33:49 2003] [notice] child pid 2552 exit signal > Segmentation fault (11) > [Sun Oct 05 21:33:51 2003] [notice] child pid 2554 exit signal > Segmentation fault (11) > [Sun Oct 05 21:33:52 2003] [notice] child pid 2556 exit signal > Segmentation fault (11) > [Sun Oct 05 21:33:52 2003] [notice] child pid 2555 exit signal > Segmentation fault (11) > [Sun Oct 05 21:33:53 2003] [notice] SIGHUP received. Attempting to > restart > [Sun Oct 05 21:33:53 2003] [notice] seg fault or similar nasty error > detected in the parent process > > If I do an apachectl start and retry I have the same error... :-( > > Any idea to fix that ? Do you want me to recompile it with debug options > ? (If that can help, I will do) > >> > I don't know, I've written to the maintainer but until now I never >> > received any answer from him. Is there a CVS somewhere with that >> > project >> >> Not that I know of. > > Do you think that the mod_auth_pgsql module is still maintained ? We can > wait one week (maybe Giuseppe Tanzilli in on vacations) before > re-talking about it. However I am asking myself some questions because > this bug is so big (the mod_auth_pgsql for Apache2 is broken) and the > latest mod_auth_pgsql is seven months old. > > Either that project is maintained or not, a CVS could be usefull to > allow multiple people submitting patches and documentation improvements > for the mod_auth_postgresql module. I would be interested to improve the > documentation of this module in order to make easier for people to use > that module (and, in the same time, promoting PostgreSQL). > > Regards, > > --------------------------------------- > Bruno BAGUETTE - pgsql-ml@baguette.net > > > ------------------------------------- Giuseppe Tanzilli info@giuseppetanzilli.it
Hello, I've just tested mod_auth_pgsql 2.0.2b1 using Auth_PG_connection_reuse on and off and it seems OK for me :-) By the way, is there a way to calculate the minimal number of PostgreSQL connections I have to setup in the postgresql.conf on the basis of the maximum request allowed in the Apache httpd.conf ? Thanks a lot Giuseppe :-) Regards, ---------------------------------------- Bruno BAGUETTE - pgsql-ml@baguette.net