DBCP Datasource error on Jira

Rahul Aich [Nagra]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 18, 2013

Hi All

My Jira instance (5.0.2) crashed all of a sudden. When I checked the error logs I got this. Can anyone please suggest how this can be handled in future?

Note : I had only 512 MB memory allocated to the jira instance. Is this error in anyway related to less memory allocation?

2013-02-19 05:18:38,191 http-8096-2 ERROR newcombe 318x5405x5 lt1f2c 10.8.1.42 /rest/gadget/1.0/issueTable/jql [NoModule] There was an error getting a DBCP datasource.
java.lang.RuntimeException: Unable to obtain a connection from the underlying connection pool

2013-02-19 05:18:39,801 http-8096-2 ERROR newcombe 318x5405x5 lt1f2c 10.8.1.42 /rest/gadget/1.0/issueTable/jql [search.parameters.lucene.DefaultPermissionQueryFactory] Error occurred retrieving security levels for this user

2013-02-19 05:18:43,332 http-8096-3 ERROR newcombe 318x5488x3 lt1f2c 10.8.1.42 /secure/ViewProfile.jspa [NoModule] There was an error getting a DBCP datasource.
java.lang.RuntimeException: Unable to obtain a connection from the underlying connection pool

2013-02-19 05:18:44,004 http-8096-3 ERROR newcombe 318x5488x3 lt1f2c 10.8.1.42 /secure/ViewProfile.jspa [webwork.util.ValueStack] METHOD: "avatarId", exception:
com.opensymphony.module.propertyset.PropertyImplementationException: Unable to esablish a connection with the database. (Out of memory (Needed 46320 bytes))

2 answers

1 accepted

3 votes
Answer accepted
pkirkeby
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2013

Looks like a loss of connection in the database pool:

https://confluence.atlassian.com/display/JIRAKB/Unable+to+obtain+a+connection+from+the+underlying+connection+pool

I would recommend setting the Validation Query and see if that helps:

https://confluence.atlassian.com/display/JIRA/Surviving+Connection+Closures

Cheers,

Pelle

Rahul Aich [Nagra]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 20, 2013

Hi Pelle

Thanks for your comment. I checked and I already had the validation query in my dbconfig.xml. Looks like it fell apart due to memory limitations (512MB).

Rahul

2 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 18, 2013

Check you are using the right database driver

Try increasing the pool size in dbconfig.xml

The last line implies memory size problems, but rule out the other two first.

Rahul Aich [Nagra]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2013

Hi Nic....thanks for your comment. In my dbconfig i have these pool size configuration

<pool-min-size>20</pool-min-size>
<pool-max-size>20</pool-max-size>

What would be the recommended min and max pool size for a instance hosting 55K issues and 2K users?

On the datbase driver, I installed the MySQL Connector/J 5.1.23 that comes bundled in when installing the MySQL software. Is there anything else i need to do on the driver front?

Rahul

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 19, 2013

I'd leave the minimum pool size alone - it's more a case of "reserve enough for myself so that nothing else can degrade my performance" setting.

For the maximum pool size, the only time I've ever altered it was under the guidance of a DBA and a Tomcat expert. I seem to remember we jumped it to 100, but that was on dedicated hardware - the app server was for Jira and a handful of automated jobs related to it, the database server was running the Jira, Confluence and Fisheye databases but nothing else. However, 30,000 users and a shade over a million issues...

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 19, 2013

Not immediately.

I'd check the validation query to begin with ( https://confluence.atlassian.com/display/JIRA/Surviving+Connection+Closures ) then the driver version (yes, use the latest one that is valid for your MySQL, Tomcat and Java versions). Finally, start increasing the pool in steps of 10. Jumping to 100 is overkill - each pool connection has some overhead, so there's no point going higher than you need.

Rahul Aich [Nagra]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2013

thanks Nic. Is there any drawback of jumping the max pool size to say 100 in spite of having a small installation (2K users). We have both the Jira installation and DB on the same 4 GB VM.

I checked the MySQL connector in the lib folder and it is mysql-connector-java-5.1.10.jar. Do you think I need to replace it with the latest available from mysql website?

Rahul

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 19, 2013

Bother, just seen Pelle's answer, which I've just repeated. Sorry Pelle!

Suggest an answer

Log in or Sign up to answer