2
Looking at the graphics presented, I believe you misinterpreted the problem.
I have not seen CPU consumption as the problem, because this information is not shown. The amount of % you are seeing is not CPU, but it is time spent running that method. The cause can be several things (including CPU).
In your specific case, C3P0 seems to be taking a while to get a connection with the database. The connection pool serves to speed this up, as C3P0 keeps some connections open at all times, and when the application asks for a connection, it already has one ready to use.
However, if this stage is taking long, it is possible that the current pool is very small (in its current configuration, it is as 5) and it needs to open new connections to the database. Opening a new connection to the database is something heavier, which would explain your problem.
Another explanation is you have reached the maximum number of connections, which you currently set as 20. When this occurs, the system needs to wait to use an open connection, which would also explain the delay.
The above two cases can be monitored on the server or directly in the database, following the amount of open connections.
To improve, you can increase the minimum or maximum pool of connections, depending on your problem. Try a number greater than 5 for the minimum, for example. The exact number I can’t tell which can be, as it depends a lot on your application and the server.
Note that this problem is more serious at specific times (such as at dawn) also check if there is no heavy routine being run in the database during hours. Maybe this can affect the opening time of a new connection.
Marlucio, what’s the app’s database? See if there are any Ocks in the database. Other than that, what has changed in the life of the application (use or update) that coincides with the increase in CPU consumption?
– Badaro
Mysql Bank 5.6. It hasn’t changed much. What’s strange to me is that even without anyone using it, like hours at dawn. Or without session are generating such consumption.
– Marlucio Pires