Corey Puffalt wrote:
Chris,
On 6/20/06, *Chris Holmes* <cholmes@anonymised.com <mailto:cholmes@anonymised.com>> wrote:
Yeroc wrote:
> I'm running v1.3.0... did it have a similar issue? What I'm
observing
> doesn't look like connection leaking though that's
possible. What I'm
> seeing is that if there are 64 simultaneous hits requesting a map
then I
> have 64 open connections to the database (which makes
sense). I'm looking
> for a way of limiting the number of open connections to the
database. Most
> connection pools allow the user to configure a maximum number of
> connections. This would allow me to throttle things down to
something
> reasonable. This would mean some of the requests would have to block
> waiting for a database connection to be freed up...but I'd rather
have that
> happen than kill the database server.
Ah, I get you. No, that's a different issue, not in 1.3.0. Yeah, that
would be an advantage of going with a better known connection pooling
library. Though configuring it would add a bunch of options that would
be confusing for most people. You can submit the request to our JIRA
task tracker.
With reasonable defaults people that are setting up an installation to play around with wouldn't have to worry about the extra parameters.
Yeah, ideally we could have 'basic' and 'advanced' config sections
I would argue that this is going to be an issue for nearly anyone setting up GeoServer in a production environment though. The problem is particularly evident when using a WMS client like openlayers that tiles requests and I think we will see more and more clients moving in this direction.
Yeah, I agree.
Is it possible to throttle it on the database side? Can't postgres
limit the number of connections on its end? Or does that cause nasty
errors?
I'm not a Postgres guru but my understanding is that there is only a global max connections setting. This is not a solution to the problem though. As you suggest you'll just end up getting SQLExceptions resulting in broken images. I think it's far better to have a solution that results in a slowdown in the rendering process (block waiting for an available connection) than having errors thrown back to the client. Additionally, what about database servers that are shared with other users? I don't think Postgres has a maximum connections per user setting (I could be wrong.) For instance, in my case, there's another process running periodically to update the postgres database with new data from another production (Oracle) database. I can't have these updates failing because GeoServer is using up all the connections...
I will submit a JIRA ticket...
Cool. I'll try to get to it relatively soon. It's just that it involves touching a lot of classes that are known to work, fixing something which for the most part isn't broke. And that is generally a pain to fix. If others who want this issue could vote on it that will increase its chances of it getting fixed sooner (or if someone actually wants to fund it or donate their time to working on it).
If there are interim solutions like setting postgres max connections that would be nice. Do you have a recommendation of a good open source connection pooling implementation to use? Though at this point it may just be easier to just have our implementation borrow some code to do maxConnections from one that does it.
Chris
Regards,
Corey
!DSPAM:1003,4498779f280722223018498!
--
Chris Holmes
The Open Planning Project
http://topp.openplans.org