Opened 8 years ago

Closed 8 years ago

#1359 closed defect (fixed)

Petascope should use a connection pool instead of a new connection for each request

Reported by: Alex Dumitru Owned by: Bang Pham Huu
Priority: major Milestone: 9.3
Component: petascope Version: development
Keywords: Cc: Dimitar Misev
Complexity: Medium

Description

This affects WMS requests where you can get more than 100 requests at a time (each tile in a client like openlayers is a request) combined with the default postgresql limit of 100 connections at the same time.

The change should be trivial, there is a JDBCConnectionPool available in the apache libraries and we should use that one instead of JDBCConnection.

Change History (4)

comment:1 by Bang Pham Huu, 8 years ago

Owner: changed from Alex Dumitru to Bang Pham Huu
Status: newassigned

I also think I can do it, then assign to me.

comment:2 by Bang Pham Huu, 8 years ago

I used the JdbcPooledConnectionSource instead of JdbcConnectionSource http://ormlite.com/javadoc/ormlite-jdbc/com/j256/ormlite/jdbc/JdbcPooledConnectionSource.html

with a script test to query multiples WMS requests, it will be stopped to 100 connections as same as the JdbcConnectionSource in few seconds.

comment:3 by Bang Pham Huu, 8 years ago

Cc: Dimitar Misev added
Priority: minormajor

The problem cannot be resolved by the JdbcPooledConnectionSource and in general, this ticket is important because:
+ Each WMS request will occupy 3 connections to Postgresql and as I see, it takes long time to release (I think 20'). Then with some high-traffic query, just few seconds, it will go to maximum connection (i.e: in Postgresql is 100) and WMS also cannot handle requests.

+ I would think about the role of "PersistentMetadataObjectProvider" in WMS 1.3, it works as a middle layer to add, update data in Postgresql. However, I think when WMS was initialised (i.e: data was ingested), it does not need to even touch Postgresql because all metadata can get from CoverageMetadata for translating to Rasql query.

comment:4 by Dimitar Misev, 8 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.