Hello Ivy team,

By the default, an ivy datasource has max connection is "5". Now we are facing with an issue that our application run very slowly. If we change the max connection from "5" to "50", the performance is really better, we can see the big different result after changing.

The question is what is the suitable number of max connection? And can you share a little bit how you handle the connection pool in Ivy?

Best regards, Nam Nguyen

asked 01.08.2016 at 12:08

namnguyenwow's gravatar image

namnguyenwow
(suspended)
accept rate: 0%


Hi

The number of max connection that suits best is depending on the project and the number of concurrent users. It is therefore not easy to define a good default value that suits all problems well. If you see bad performance use our VisualVM Plugin. There you see how many database connection are currently in use and what are the response times of the databases. If the number of database connection is almost at the maximum it is appropriate to increase the maximum.

Note, that it might be counterproductive to increase the maximum database connection to a high value, since each connection consumes resources on the database server.

Also have a look at the list with the slowest SQL statements. If a statement needs more than a second to execute it, it is worth to analyse the statement and try to optimize it. Note, that a database connection is reserved by a SQL statement. The longer a statement takes to execute the longer a database connection is reserved and meanwhile cannot be used by other request threads. Sometimes an additional index on a table column can boost performance by a factor of 1000. Especially if you have a lot of rows. Use database tools to explain how the SQL Statement is executed and find out if indexes are used to execute the statement or not.

For more information about our VisualVM Plugin see here: VisualVM Plugin

link

answered 03.08.2016 at 17:39

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.9k202857
accept rate: 74%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×32

Asked: 01.08.2016 at 12:08

Seen: 1,848 times

Last updated: 03.08.2016 at 17:39