Hi, As Romain mentioned, if you could provide us with a JVM thread dump when that happens, we could check if the pool activity is the cause.
Side note, the configuration seems quite strange to me - maxWaitTime = -1 means infinite. I usually prefer to set a value to avoid a user (aka a thread) hanging for ever. Especially because a user is tempted to click many times in the UI lol - looks like you set up the eviction thread but testWhileIdle and the timeBetweenEvictionRuns is not configured - maxOpenPreparedStatements = 0 --> usually not a good idea for performances and especially from a DB point of view cause it has to compile your statement each and every time. Obviously you have to use prepared statements in your application, which is often the case when using JPA. -- Jean-Louis Monteiro http://twitter.com/jlouismonteiro http://www.tomitribe.com On Thu, Jul 23, 2015 at 7:34 AM, Steve Singer <[email protected]> wrote: > We are using TomEE (Tomcat with OpenEJB) to connect to a SQL Server > database. > The connection works fine, but we are seeing odd CPU creeping issues. The > application runs and performs well for about 24 hours (SQL Server CPU at > about 15%-20%), and then performance starts to suffer after that. We check > and the CPU is now at 60%. If we shut down the running jobs (but leave > Tomcat running), the CPU drop down to almost zero. If we restart the > processing, the CPU jumps back up immediately to the 60%. If we stop the > Tomcat instance and then restart, then the CPU usage on the SQL Server > machine stays at its low usage for about 24 hours and then it begins to > creep back up again. > > I think that this must be due to the datasource configuration, but I'm not > sure what changes we should make. Can someone help out? Here is the > datasource configuration we are using: > > <Resource id="Datasource" type="javax.sql.DataSource"> > accessToUnderlyingConnectionAllowed = false > defaultAutoCommit = true > ignoreDefaultValues = false > initialSize = 0 > jdbcDriver = com.microsoft.sqlserver.jdbc.SQLServerDriver > jdbcUrl = jdbc:sqlserver://{url} > jtaManaged = true > maxActive = 200 > maxIdle = 20 > maxOpenPreparedStatements = 0 > maxWaitTime = -1 millisecond > minEvictableIdleTime = 30 minutes > minIdle = 0 > numTestsPerEvictionRun = 3 > password = {password} > passwordCipher = Static3DES > poolPreparedStatements = false > testOnBorrow = true > testOnReturn = false > testWhileIdle = false > timeBetweenEvictionRuns = -1 millisecond > userName = {user} > validationQuery = SELECT 1 > </Resource> > > Thanks in advance! > > > > -- > View this message in context: > http://tomee-openejb.979440.n4.nabble.com/TomEE-Datasource-Connection-to-SQL-Server-CPU-Creep-tp4675573.html > Sent from the TomEE Users mailing list archive at Nabble.com. >
