關於連線人數問題

若您找不到合適的版面發表文章,來這裡就對了啦!

版主: E-Office小組

分享到: Facebook

關於連線人數問題

文章ppp90139 » 週四 1月 02, 2014 4:48 pm

我有一個系統是由java開發的
server環境是apache與tomcat組成的
我目前的問題是
系統一旦超過10人以上同一時間使用,server就會當掉,
導致已登入的人,無法瀏覽資料庫的資料,
未登入系統,則無法登入系統。
重啟之後,又可以使用了。
ppp90139
問題很多的小學生
 
文章: 10
註冊時間: 週五 10月 12, 2012 9:05 am

Re: 關於連線人數問題

文章benwu » 週五 1月 03, 2014 2:14 pm

這問題的起因有太多可能性了:
可能是伺服器的連線數不夠
可能是資料庫的連線數不夠

感覺起來,資料庫連線數應該是禍首
我不是大吳老師,也不是小吳老師,我是Ben老師
我的部落格
http://eportfolio.fju.edu.tw/053792
頭像
benwu
資管系教師
 
文章: 645
註冊時間: 週二 4月 20, 2004 4:17 pm
來自: 輔大資管系

Re: 關於連線人數問題

文章XO » 週五 1月 03, 2014 6:41 pm

看看 error log 出現啥 error message!
eXtra Old 的是我「不是酒」哦!
제 이름은 오조휘 입니다

臉書裡依舊是 Extra.Old: http://www.facebook.com/extra.old
頭像
XO
資管系教師
 
文章: 5307
註冊時間: 週二 4月 27, 2004 12:20 pm
來自: CQ Inc.

Re: 關於連線人數問題

文章ppp90139 » 週一 1月 06, 2014 10:46 am

這是我的log。
[DEBUG][com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource] - com.mchange.v2.c3p0.PoolBackedDataSource@153113d has been closed.
java.lang.Exception: DEBUG STACK TRACE for PoolBackedDataSource.close().
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.close(AbstractPoolBackedDataSource.java:417)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.close(AbstractPoolBackedDataSource.java:429)
at com.mchange.v2.c3p0.DataSources.destroy(DataSources.java:359)
at com.mchange.v2.c3p0.DataSources.destroy(DataSources.java:335)
at org.hibernate.connection.C3P0ConnectionProvider.close(C3P0ConnectionProvider.java:204)
at org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:965)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.destroy(AbstractSessionFactoryBean.java:251)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.destroy(LocalSessionFactoryBean.java:899)
at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:211)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:498)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:474)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:442)
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1066)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1040)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:988)
at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:538)
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:142)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3973)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4577)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:924)
at org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:1248)
at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1219)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:316)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1086)
at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1098)
at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:448)
at org.apache.catalina.core.StandardService.stop(StandardService.java:584)
at org.apache.catalina.core.StandardServer.stop(StandardServer.java:744)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:633)
at org.apache.catalina.startup.Catalina.start(Catalina.java:608)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
[DEBUG][com.mchange.v2.c3p0.impl.NewPooledConnection] - com.mchange.v2.c3p0.impl.NewPooledConnection@1b7edd3 closed by a client.
java.lang.Exception: DEBUG -- CLOSE BY CLIENT STACK TRACE
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:491)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:191)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:989)
at com.mchange.v2.resourcepool.BasicResourcePool.access$100(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:1174)
[DEBUG][com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool] - Successfully destroyed PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@1b7edd3
[DEBUG][com.mchange.v2.resourcepool.BasicResourcePool] - Successfully destroyed resource: com.mchange.v2.c3p0.impl.NewPooledConnection@1b7edd3
[DEBUG][com.mchange.v2.resourcepool.BasicResourcePool] - Preparing to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@19480b8
[DEBUG][com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool] - Preparing to destroy PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@19480b8
[DEBUG][com.mchange.v2.c3p0.impl.NewPooledConnection] - com.mchange.v2.c3p0.impl.NewPooledConnection@19480b8 closed by a client.
java.lang.Exception: DEBUG -- CLOSE BY CLIENT STACK TRACE
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:491)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:191)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:989)
at com.mchange.v2.resourcepool.BasicResourcePool.access$100(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:1174)
[DEBUG][com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool] - Successfully destroyed PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@19480b8
[DEBUG][com.mchange.v2.resourcepool.BasicResourcePool] - Successfully destroyed resource: com.mchange.v2.c3p0.impl.NewPooledConnection@19480b8
[DEBUG][com.mchange.v2.resourcepool.BasicResourcePool] - Preparing to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@9d5793
[DEBUG][com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool] - Preparing to destroy PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@9d5793
[DEBUG][com.mchange.v2.c3p0.impl.NewPooledConnection] - com.mchange.v2.c3p0.impl.NewPooledConnection@9d5793 closed by a client.
java.lang.Exception: DEBUG -- CLOSE BY CLIENT STACK TRACE
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:491)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:191)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:989)
at com.mchange.v2.resourcepool.BasicResourcePool.access$100(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:1174)
[DEBUG][com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool] - Successfully destroyed PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@9d5793
[DEBUG][com.mchange.v2.resourcepool.BasicResourcePool] - Successfully destroyed resource: com.mchange.v2.c3p0.impl.NewPooledConnection@9d5793
[DEBUG][com.mchange.v2.resourcepool.BasicResourcePool] - Preparing to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@5ed853
[DEBUG][com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool] - Preparing to destroy PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@5ed853
[DEBUG][com.mchange.v2.c3p0.impl.NewPooledConnection] - com.mchange.v2.c3p0.impl.NewPooledConnection@5ed853 closed by a client.
java.lang.Exception: DEBUG -- CLOSE BY CLIENT STACK TRACE
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:491)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:191)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470)
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:989)
at com.mchange.v2.resourcepool.BasicResourcePool.access$100(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:1174)
ppp90139
問題很多的小學生
 
文章: 10
註冊時間: 週五 10月 12, 2012 9:05 am

Re: 關於連線人數問題

文章XO » 週一 1月 06, 2014 11:31 am

我在猜你該不會是 maxPoolSize 設為 10,然後沒把 connection pool 的 close() 寫好,導致資料庫連線連上用完後沒 close,第十一個 client 進來時,connection pool 連線用滿,無法連線... (Just a wild guess!)

網路上蒐來這一篇:

C3PO Exception - CLOSE BY CLIENT?
eXtra Old 的是我「不是酒」哦!
제 이름은 오조휘 입니다

臉書裡依舊是 Extra.Old: http://www.facebook.com/extra.old
頭像
XO
資管系教師
 
文章: 5307
註冊時間: 週二 4月 27, 2004 12:20 pm
來自: CQ Inc.

Re: 關於連線人數問題

文章XO » 週一 1月 06, 2014 3:23 pm

下面還有兩篇網路文章,不知道有沒幫助就是...

  1. 奇怪的异常:DEBUG -- CLOSE BY CLIENT STACK TRACE
  2. Weird Error: CLOSE BY CLIENT STACK TRACE
  3. C3PO Exception – CLOSE BY CLIENT STACK TRACE原因和解决办法

我覺得第一篇可能會有你想要的資訊!加油囉~~~
eXtra Old 的是我「不是酒」哦!
제 이름은 오조휘 입니다

臉書裡依舊是 Extra.Old: http://www.facebook.com/extra.old
頭像
XO
資管系教師
 
文章: 5307
註冊時間: 週二 4月 27, 2004 12:20 pm
來自: CQ Inc.

Re: 關於連線人數問題

文章ppp90139 » 週二 1月 07, 2014 3:59 pm

老師請問關於 maxPoolSize是在哪邊的設定? 是apache 或 tomcat?
ppp90139
問題很多的小學生
 
文章: 10
註冊時間: 週五 10月 12, 2012 9:05 am

Re: 關於連線人數問題

文章XO » 週四 1月 09, 2014 5:48 pm

你用到了 Spring Framework,那是在 Spring 的 config 設定裡。

可以參看:

Where is the exact location of spring config file and web.xml?
eXtra Old 的是我「不是酒」哦!
제 이름은 오조휘 입니다

臉書裡依舊是 Extra.Old: http://www.facebook.com/extra.old
頭像
XO
資管系教師
 
文章: 5307
註冊時間: 週二 4月 27, 2004 12:20 pm
來自: CQ Inc.


回到 其他技術版

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 1 位訪客