✨AI算命大師
議題選項
議題評分
Re: Too many connections , 本站目前解決方案 #359696 - 2004-05-15 17:02:26
七龍珠 離線
或躍在淵
註冊: 2004-05-04
文章數: 257
來自: 花果山
回應:

回應:

you have to rewrite the php forum such that it uses mysql_connect() (NOT mysql_pconnect()) and retains some of the mysql connection threads on the server side.






最主要的原因是 table lock .

是先因為 table lock 才會導致 too many connections 的

所以,即使加上 connection pool 也無濟於事

(否則本站最多線上四百多人,大家都在 reading , 網站速度仍然飛快...)



而 table lock 的主因: 硬碟不夠快、不是 SCSI 硬碟、資料庫不是獨立主機 ...






我覺得 Connection Pooling 是有正面效應的。Database Connection 本就 expensive, 會用到 CPU 的不少資源﹐也影響 MySQL 的速度。試想每一 Connection 省一秒﹐每天有多少個 Connection? 省下來的時間可讓 MySQL 處理其它 request, 良性循環﹐現在可是惡性循環啊~~



您提到 Table Lock, 我假定您是用 MyISAM Table Type (supports Table Level Locking). 如確實如此﹐而您的 MySQL 版本又 supports InnoDB 的話﹐我建議您換去 InnoDB Table Type (supports Row Level Locking), 那麼﹐ Insert/Update/Delete 就不需要 Lock 整個 Table 了。



我覺得硬件倒不是最主要的原因﹐因為 PHP Web Application 及 Database Design 還有很多待改善的空間﹐MySQL Performance Tuning 也會有明顯的幫助。
_________________________
命運可改變﹐先問您意願。旁人幫不了﹐命運在您手。
有病方為貴﹐無煞不成奇。逆境要求存﹐強者得永生。
廣告




全部議題
議題 貼文者 : 張貼日期
Too many connections , 本站目前解決方案 站長 2004-04-26 16:46:31
Re: Too many connections , 本站目前解決方案 pingpoing 2004-04-28 06:05:11
Re: Too many connections , 本站目前解決方案 站長 2004-04-28 06:30:34
Re: Too many connections , 本站目前解決方案 七龍珠 2004-05-15 17:02:26
Re: Too many connections , 本站目前解決方案 站長 2004-05-15 17:12:01
Re: Too many connections , 本站目前解決方案 七龍珠 2004-05-15 17:57:38
Re: Too many connections , 本站目前解決方案 jerryen 2004-05-30 13:37:07
Re: Too many connections , 本站目前解決方案 小苦 2004-05-04 15:25:48
Re: Too many connections , 本站目前解決方案 站長 2004-05-04 15:29:04
Re: Too many connections , 本站目前解決方案 伍修羅 2004-05-07 07:42:39
Re: Too many connections , 本站目前解決方案 站長 2004-05-07 08:14:14
Re: Too many connections , 本站目前解決方案 伍修羅 2004-05-07 08:42:28
Re: Too many connections , 本站目前解決方案 命也!! 2004-05-09 02:56:13
Re: Too many connections , 本站目前解決方案 Miki 2004-05-09 02:47:40
Re: Too many connections , 本站目前解決方案 站長 2004-05-09 08:59:08
Re: Too many connections , 本站目前解決方案 Miki 2004-05-09 12:05:46
Re: Too many connections , 本站目前解決方案 pingpoing 2004-06-14 10:03:45


本站是個命理討論的園地,如果您要問命,請務必詳閱各板板規,遵守發問規則,不要只留個生日或是命盤, 其他什麼都沒提。貼命盤的方法請特別注意算完命盤後的文字說明,不要貼個沒人看懂歪七扭八的命盤, 貼錯命盤及未遵守板規者,文章很有可能被不預警刪除 另外,如果您提了問題,而有人回覆的話,不論對與錯,請務必多上來回應論命者, 我們不歡迎那種提了問題就等人回答,也不回應的人。我們需要的是,「良好的互動」及「長期的追蹤」。
本站大多數的討論區都得要註冊才能發言,您若是要張貼討論,請務必註冊為使用者, 如果您忘了您的密碼,請在登入」的畫面, 輸入您的帳號,再按一下我忘記我的密碼了」, 此時系統會寄一封信到您當時註冊的 Email 信箱裡面, 裡面則附有一個臨時密碼,請您拿到密碼後用此臨時密碼登入。登入之後可以在 編輯個人檔案」裡面修改成您習慣的密碼。
logo
欣洋網路有限公司