From: Hume, J. - NA US HQ D. <JH...@my...> - 2003-12-08 20:59:50
|
Greetings ... I'm new to Proxool so forgive me if this has been discussed or addressed, but I didn't see anything in the archives that seemed related. In ConnectionPool.testConnection(ProxyConnectionIF), if the createStatement() on line 278 throws anything (for example because the connection was unexpectedly closed), then s never gets assigned, so the s.close() in the finally block throws a NullPointerException, preventing testConnection from returning false. I know this should be a rare occurence, but it's currently happening to us with great frequency for some unknown reason. (We were blaming Jakarta DBCP, which is why I was working on implementing proxool, but now it looks like our problem lies elsewhere.) I added "if(s!=null)" to the beginning of line 288 to get around this. Let me know if you'd like me to submit this as a bug and/or patch on sourceforge. Thanks. -john. _____________ john d. hume 561-266-6256 john.hume at cruisesonly.com |
From: Bill H. <bi...@lo...> - 2003-12-09 08:50:55
|
Hi John, On Mon, 2003-12-08 at 21:58, Hume, John - NA US HQ Delray wrote: > I added "if(s!=null)" to the beginning of line 288 to get around this. Let > me know if you'd like me to submit this as a bug and/or patch on > sourceforge. Thanks. Thanks for the contribution. Yes please, either submit a patch on sourceforge or just email me the diff and I will be happy to incorporate the fix into our next release (which isn't that far away). Regards, Bill Horsman |
From: Jean-Henry B. <ber...@ne...> - 2003-12-10 10:52:47
|
Hi, I am using proxool for some time in my project and I am very pleased with the performance and functionality I get from it. I mainly used my server to connect to an Informix database, but I recently did a port to handle PostgreSQL connections also. There is a problem in this new setup: the unused connections are released at a slower pace, much slower than in the Informix case. Is there any known issue with proxool when connecting to a PostgreSQL DB in the line I am describing here? The real problem is that I am expecting to reuse connections a lot and if they are released with big delays, this generates a lot of new connections. The effect is that everything slows down and at certain points I reach system limitations (max connection number for example) Best regards, Jean |
From: Bill H. <bi...@lo...> - 2003-12-10 11:49:52
|
Hi Jean, On Wed, 2003-12-10 at 11:52, Jean-Henry Berevoescu wrote: > There is a problem in this new setup: the unused connections are released > at a slower pace Can you clarify what you mean by "released"? The life cycle is that a connection is built, [served, returned,]* destroyed. Which bit is taking a long time? > Is there any known issue with proxool when connecting to a PostgreSQL DB No. > The real problem is that I am expecting to reuse connections a lot By "reuse" do you mean serve the same connection lots of times? Serving (and returning) a connection should be very quick. Have you tried switching trace on? That will give you the performance of your database calls. Could it be that the database is performing slowly and that is what is causing many connections to be built? Regards, Bill Horsman |
From: Jean-Henry B. <ber...@ne...> - 2003-12-10 12:31:16
|
bi...@lo... wrote: >Hi Jean, > >On Wed, 2003-12-10 at 11:52, Jean-Henry Berevoescu wrote: > > > >>There is a problem in this new setup: the unused connections are released >>at a slower pace >> >> > >Can you clarify what you mean by "released"? The life cycle is that a >connection is built, [served, returned,]* destroyed. Which bit is taking >a long time? > > It is al acting in a weird way. What I do is build-use-returnToPool but what I see is a lot of connections being created and a lot of them lingering in TIME_WAIT state. It is not very clear why. >>The real problem is that I am expecting to reuse connections a lot >> >> > >By "reuse" do you mean serve the same connection lots of times? Serving >(and returning) a connection should be very quick. > > Yes - the pattern of use is as I said before: create-use-returnToPool >Have you tried switching trace on? That will give you the performance of >your database calls. Could it be that the database is performing slowly >and that is what is causing many connections to be built? > I switched the tracing on for a short test, but I will do it again and will take a closer look. Thanks, Jean > >Regards, >Bill Horsman > > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program. >Does SourceForge.net help you be more productive? Does it >help you create better code? SHARE THE LOVE, and help us help >YOU! Click Here: http://sourceforge.net/donate/ >_______________________________________________ >Proxool-developer mailing list >Pro...@li... >https://lists.sourceforge.net/lists/listinfo/proxool-developer > > |
From: Jean-Henry B. <ber...@ne...> - 2003-12-10 23:17:15
|
The traces are not showing anything unusual, but I noticed another thing: - I start with minumumConnectionCount set to, say, 30. Proxool is correctly building 30, but the first time I need a connection it builds another one, and another one and so on, every time a need a connection from the pool. So it looks like the reusability is not working. Again, it was working all right with Informix, but not with PostgreSQL. The trace shows something like this when I start: ========================================================================== 0 [main] INFO org.logicalcobwebs.proxool.ProxoolFacade - Proxool 0.8.2 (05-Nov-2003 10:48) 39 [main] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - Recognised proxool property: proxool.driver=org.postgresql.Driver 39 [main] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - Recognised proxool property: proxool.url=jdbc:postgresql://pogo:5434/gex_runtime:user=postgres;password=post.gres 41 [main] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - Recognised proxool property: proxool.minimum-connection-count=30 42 [main] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - Recognised proxool property: proxool.maximum-active-time=4000 42 [main] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - Delegating property to driver: user=postgres 43 [main] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - Recognised proxool property: proxool.maximum-connection-lifetime=60000000 43 [main] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - Recognised proxool property: proxool.house-keeping-sleep-time=600000 43 [main] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - Delegating property to driver: password=******** 44 [main] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - Recognised proxool property: proxool.verbose=true 44 [main] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - Recognised proxool property: proxool.trace=true 45 [main] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - Recognised proxool property: proxool.house-keeping-test-sql=select count(*) from sid_content_four; 45 [main] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - Recognised proxool property: proxool.maximum-connection-count=1000 207 [main] DEBUG org.logicalcobwebs.proxool.ShutdownHook - Registered shutdownHook 226 [main] DEBUG org.logicalcobwebs.proxool.HouseKeeperController - Registering 'globexplorer_0' house keeper 244 [main] DEBUG org.logicalcobwebs.proxool.HouseKeeperController - Starting a house keeper thread 247 [HouseKeeper] INFO org.logicalcobwebs.proxool.globexplorer_0 - Proxool statistics legend: "s - r (a/t/o)" > s=served, r=refused (only shown if non-zero), a=active, t=total, o=offline (being tested) 256 [HouseKeeper] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - 000000 (00/00/00) - House keeping triggerSweep done 671 [Prototyper] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - Remembering default value: isReadOnly() = false 987 [Prototyper] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - org.postgresql.Driver does not support getHoldability. Proxool doesn't mind. 988 [Prototyper] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - org.postgresql.Driver does not support setHoldability. Proxool doesn't mind. 993 [Prototyper] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - Remembering default value: getTransactionIsolation() = 2 995 [Prototyper] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - Remembering default value: getTypeMap() = null 996 [Prototyper] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - Remembering default value: getCatalog() = gex_runtime ========================================================================== What exactly "Holdability" means? I noticed I have it with Informix, but not here. Also, how one can programatically set the connection to be readOnly? I always use it as readOnly in what I try to do here and I noticed proxool is setting it to default = false. All the other properties are set in my server with something like: info.setProperty("proxool.maximum-connection-count", connCount); Thanks and best regards, Jean Jean-Henry Berevoescu wrote: > > > bi...@lo... wrote: > >>Hi Jean, >> >>On Wed, 2003-12-10 at 11:52, Jean-Henry Berevoescu wrote: >> >> >> >>>There is a problem in this new setup: the unused connections are released >>>at a slower pace >>> >>> >> >>Can you clarify what you mean by "released"? The life cycle is that a >>connection is built, [served, returned,]* destroyed. Which bit is taking >>a long time? >> >> > It is al acting in a weird way. What I do is build-use-returnToPool > but what I see > is a lot of connections being created and a lot of them lingering in > TIME_WAIT > state. It is not very clear why. > >>>The real problem is that I am expecting to reuse connections a lot >>> >>> >> >>By "reuse" do you mean serve the same connection lots of times? Serving >>(and returning) a connection should be very quick. >> >> > Yes - the pattern of use is as I said before: create-use-returnToPool > >>Have you tried switching trace on? That will give you the performance of >>your database calls. Could it be that the database is performing slowly >>and that is what is causing many connections to be built? >> > I switched the tracing on for a short test, but I will do it again and > will take a > closer look. > > Thanks, > Jean > >>Regards, >>Bill Horsman >> >> >> >>------------------------------------------------------- >>This SF.net email is sponsored by: SF.net Giveback Program. >>Does SourceForge.net help you be more productive? Does it >>help you create better code? SHARE THE LOVE, and help us help >>YOU! Click Here: http://sourceforge.net/donate/ >>_______________________________________________ >>Proxool-developer mailing list >>Pro...@li... >>https://lists.sourceforge.net/lists/listinfo/proxool-developer >> >> |
From: Bill H. <bi...@lo...> - 2003-12-11 09:00:03
|
Hi Jean, On Thu, 2003-12-11 at 00:16, Jean-Henry Berevoescu wrote: > The traces are not showing anything unusual, but I noticed another > thing: > - I start with minumumConnectionCount set to, say, 30. Proxool is > correctly > building 30, but the first time I need a connection it builds another > one, and > another one and so on, every time a need a connection from the pool. > So it looks like the reusability is not working. > Again, it was working all right with Informix, but not with > PostgreSQL. I'd like to see more of the log to find out what's going on there. It should show those initial 30 connections being built. And then it will show what happens when you ask for your first connection to use. We can then see whether it is reusing one of those initial 30 or making a new one. > 987 [Prototyper] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - > org.postgresql.Driver does not support getHoldability. Proxool doesn't > mind. > 988 [Prototyper] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - > org.postgresql.Driver does not support setHoldability. Proxool doesn't > mind. [snip] > What exactly "Holdability" means? I noticed I have it with Informix, > but not here. It's part of the JDBC API, but not all Drivers support it. Like the log says, Proxool doesn't mind either way. You'll find that your Informix driver does support it whilst your Postgresql one doesn't. > Also, how one can programatically set the connection to be readOnly? I > always use it as readOnly in what I try to do here and I noticed > proxool is setting it to default = false. Proxool is simply remembering the readOnly state of new connections. The default state is false (that is, writable). That is how the connections are supplied from the Postgresql Driver. Proxool resets all these states to their original values when you return a connection to the pool. Otherwise, if you changed something it would remain at that new value when you asked for another connection and that might not be what you want. So: every time you ask Proxool for a connection it comes in the sames state as when it arrived, fresh from the Postgresql Driver. Regards, Bill Horsman |
From: Jean-Henry B. <ber...@ne...> - 2003-12-11 09:38:26
|
bi...@lo... wrote: >Hi Jean, > >On Thu, 2003-12-11 at 00:16, Jean-Henry Berevoescu wrote: > > > >>The traces are not showing anything unusual, but I noticed another >>thing: >>- I start with minumumConnectionCount set to, say, 30. Proxool is >>correctly >>building 30, but the first time I need a connection it builds another >>one, and >>another one and so on, every time a need a connection from the pool. >>So it looks like the reusability is not working. >>Again, it was working all right with Informix, but not with >>PostgreSQL. >> >> > >I'd like to see more of the log to find out what's going on there. It >should show those initial 30 connections being built. And then it will >show what happens when you ask for your first connection to use. We can >then see whether it is reusing one of those initial 30 or making a new >one. > > I have set the verbose and trace properties to "true", but I didn't see anything reported by proxool when the client-side is asking for a connection from the pool. Is there a way to set the verbosity/debug level somehow? >>987 [Prototyper] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - >>org.postgresql.Driver does not support getHoldability. Proxool doesn't >>mind. >>988 [Prototyper] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - >>org.postgresql.Driver does not support setHoldability. Proxool doesn't >>mind. >> >> >[snip] > > >>What exactly "Holdability" means? I noticed I have it with Informix, >>but not here. >> >> > >It's part of the JDBC API, but not all Drivers support it. Like the log >says, Proxool doesn't mind either way. You'll find that your Informix >driver does support it whilst your Postgresql one doesn't. > > Indeed - the Informix driver has it. I understand it has something to do with the number of rows in a ResultSet - or something in this line. >>Also, how one can programatically set the connection to be readOnly? I >>always use it as readOnly in what I try to do here and I noticed >>proxool is setting it to default = false. >> >> > >Proxool is simply remembering the readOnly state of new connections. The >default state is false (that is, writable). That is how the connections >are supplied from the Postgresql Driver. Proxool resets all these states >to their original values when you return a connection to the pool. >Otherwise, if you changed something it would remain at that new value >when you asked for another connection and that might not be what you >want. So: every time you ask Proxool for a connection it comes in the >sames state as when it arrived, fresh from the Postgresql Driver. > > I will keep setting the connection to readOnly when I ask for one. No problem. Thanks, Jean >Regards, >Bill Horsman > > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program. >Does SourceForge.net help you be more productive? Does it >help you create better code? SHARE THE LOVE, and help us help >YOU! Click Here: http://sourceforge.net/donate/ >_______________________________________________ >Proxool-developer mailing list >Pro...@li... >https://lists.sourceforge.net/lists/listinfo/proxool-developer > > |
From: Jean-Henry B. <ber...@ne...> - 2003-12-11 10:02:42
|
I redid the tests in verbose mode and I notice that at init time I get the usual lines like: 4220 [Prototyper] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - 000000 (00/24/00) - Connection #24 (719f1f) created to achieve minimum of 30 = AVAILABLE -> jdbc:postgresql://pogo:5434/gex_runtime:user=postgres;password=post.gres (185ad79) by thread Prototyper There are 30 of these (as I said the min number of conns is 30) - nothing unusual here. The weird part comes after that: when I do a server request (which usually asks for around 4 connections from proxool) no lines like these appear (which would mean, I guess, that no new connections are created by proxool) but doing netstat I notice that the number of connections is N+4 now, and the number of active ones remains N - the others are in TIME_WAIT mode and are cleaned when the sweeper kicks in. Then the question would be: what's with these additional connections I see? (in time, if I do a stress test, the number of connections raises to hundreds or even thousands, but the pattern remains: the active ones are as many as I expect and the bulk are connections in TIME_WAIT state) Thanks, Jean Bill Horsman wrote: >Hi Jean, > >On Thu, 2003-12-11 at 00:16, Jean-Henry Berevoescu wrote: > > > >>The traces are not showing anything unusual, but I noticed another >>thing: >>- I start with minumumConnectionCount set to, say, 30. Proxool is >>correctly >>building 30, but the first time I need a connection it builds another >>one, and >>another one and so on, every time a need a connection from the pool. >>So it looks like the reusability is not working. >>Again, it was working all right with Informix, but not with >>PostgreSQL. >> >> > >I'd like to see more of the log to find out what's going on there. It >should show those initial 30 connections being built. And then it will >show what happens when you ask for your first connection to use. We can >then see whether it is reusing one of those initial 30 or making a new >one. > > > >>987 [Prototyper] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - >>org.postgresql.Driver does not support getHoldability. Proxool doesn't >>mind. >>988 [Prototyper] DEBUG org.logicalcobwebs.proxool.globexplorer_0 - >>org.postgresql.Driver does not support setHoldability. Proxool doesn't >>mind. >> >> >[snip] > > >>What exactly "Holdability" means? I noticed I have it with Informix, >>but not here. >> >> > >It's part of the JDBC API, but not all Drivers support it. Like the log >says, Proxool doesn't mind either way. You'll find that your Informix >driver does support it whilst your Postgresql one doesn't. > > > >>Also, how one can programatically set the connection to be readOnly? I >>always use it as readOnly in what I try to do here and I noticed >>proxool is setting it to default = false. >> >> > >Proxool is simply remembering the readOnly state of new connections. The >default state is false (that is, writable). That is how the connections >are supplied from the Postgresql Driver. Proxool resets all these states >to their original values when you return a connection to the pool. >Otherwise, if you changed something it would remain at that new value >when you asked for another connection and that might not be what you >want. So: every time you ask Proxool for a connection it comes in the >sames state as when it arrived, fresh from the Postgresql Driver. > >Regards, >Bill Horsman > > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program. >Does SourceForge.net help you be more productive? Does it >help you create better code? SHARE THE LOVE, and help us help >YOU! Click Here: http://sourceforge.net/donate/ >_______________________________________________ >Proxool-developer mailing list >Pro...@li... >https://lists.sourceforge.net/lists/listinfo/proxool-developer > > > |
From: Bill H. <bi...@lo...> - 2003-12-11 10:09:23
|
Hi Jean, On Thu, 2003-12-11 at 11:02, Jean-Henry Berevoescu wrote: > The weird part comes after that: when I do a server request (which > usually asks for around 4 connections > from proxool) no lines like these appear (which would mean, I guess, > that no new connections are > created by proxool) What's the URL you are using to ask for connections to the database? Are you sure you are using Proxool? Is it possible that you are asking the Postgresql Driver directly? Regards, Bill |
From: Jean-Henry B. <ber...@ne...> - 2003-12-11 10:25:38
|
bi...@lo... wrote: >Hi Jean, > >On Thu, 2003-12-11 at 11:02, Jean-Henry Berevoescu wrote: > > > >>The weird part comes after that: when I do a server request (which >>usually asks for around 4 connections >>from proxool) no lines like these appear (which would mean, I guess, >>that no new connections are >>created by proxool) >> >> > >What's the URL you are using to ask for connections to the database? Are >you sure you are using Proxool? Is it possible that you are asking the >Postgresql Driver directly? > >Regards, >Bill > > > I think you are right with this one - but then, why is it working all right with Informix? If I have something like: jdbc:postgresql://host:port/dbName:user=...;password=... what would be the URL for Proxool? Something like this: jdbc:proxool://host:port etc? But I don't have a real host port and everything for proxool. When I registered proxool I did all this by setting its properties. Thanks, Jean |
From: Bill H. <bi...@lo...> - 2003-12-11 10:32:46
|
Hi Jean, On Thu, 2003-12-11 at 11:25, Jean-Henry Berevoescu wrote: > > What's the URL you are using to ask for connections to the database? Are > > you sure you are using Proxool? Is it possible that you are asking the > > Postgresql Driver directly? > I think you are right with this one - but then, why is it working all > right with Informix? I suspect that you are bypassing Proxool with Informix too. > If I have something like: > > jdbc:postgresql://host:port/dbName:user=...;password=... > > what would be the URL for Proxool? The URL is simply: proxool.globexplorer_0 Regards, Bill Horsman |
From: Jean-Henry B. <ber...@ne...> - 2003-12-11 10:56:53
|
bi...@lo... wrote: >Hi Jean, > >On Thu, 2003-12-11 at 11:25, Jean-Henry Berevoescu wrote: > > > >>>What's the URL you are using to ask for connections to the database? Are >>>you sure you are using Proxool? Is it possible that you are asking the >>>Postgresql Driver directly? >>> >>> > > > >>I think you are right with this one - but then, why is it working all >>right with Informix? >> >> > >I suspect that you are bypassing Proxool with Informix too. > > > >>If I have something like: >> >>jdbc:postgresql://host:port/dbName:user=...;password=... >> >>what would be the URL for Proxool? >> >> > >The URL is simply: > > proxool.globexplorer_0 > >Regards, >Bill Horsman > > Bingo! It is working all right now! I'd have to go back and analyze the Informix case also. I think you are 100% right: I was bypassing it in that case also. Looking more into my code I realize that there was a part of connections I was requesting that were indeed bypassing the Proxool mechanism and this was the actual problem. I fixed it and now everything seems to be back on track. Thank you so much! Best regards, Jean |