Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 1827
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 1827
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 2180
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3025
Warning: implode() [function.implode]: Argument must be an array in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3077
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3108
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3108
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3151
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3151
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3292
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3292
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 1827
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 1827
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 2180
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3025
Warning: implode() [function.implode]: Argument must be an array in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3077
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3108
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3108
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3151
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3151
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3292
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3292
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 1827
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 1827
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 2180
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3025
Warning: implode() [function.implode]: Argument must be an array in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3077
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3108
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3108
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3151
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3151
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3292
Warning: Invalid argument supplied for foreach() in /home/tewikico/public_html/blog/wp-content/plugins/wp-syntax/geshi/geshi.php on line 3292
後端的問題
在前面的測試報告中,我們似乎看不出什麼問題,好像即使處理速度不夠,多開幾個進程就可以了。這是因爲測試是在比較理想的環境下進行的,而實際的生產環境情況要複雜得多。雖然Mongrel在此次測試的結果中顯示了很好的穩定性,但是這並不能表示Mongrel就可以在生產環境中同樣保持很好的穩定性。
原因在於Ruby的線程機制。但首先這裏要強調的是,雖然Ruby的虛擬機有缺陷,線程是僞線程,線程性能較差,但這並不妨礙Ruby可以做一些同步或異步的工作(可以參考Erlang)。問題的關鍵在於Rails本身不是線程安全的,如果查看Mongrel的代碼則會發現,Mongrel在調用 Rails的分發器之前就加了鎖,直到Rails處理完這個請求。請參考/var/lib/gems/1.8/gems/mongrel-1.1.4 /lib/mongrel/rails.rb第74行(不同的系統上的目錄有所不同,不同版本的mongrel,代碼出現的位置也可能不同)如下:
<span style="background-color: rgb(255,255,0)">@guard.synchronize {</span><br > @active_request_path = request.params[Mongrel::Const::PATH_INFO] <br > Dispatcher.dispatch(cgi, <br >
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, [...]
淺析Ruby on Rails部署方案(二)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
PHP+jQuery實現即點即改功能示例
ztblog
2019-02-24 12:43:05
PHP+jQuery實現雙擊修改table表格功能示例
ztblog
2019-02-24 12:43:05
PHP基於mcript擴展實現對稱加密功能示例
ztblog
2019-02-24 12:43:05
eAccelerator 配置參數詳解
小紅帽子
2019-02-23 13:37:48
ThinkPHP簡易微信公衆號零錢提現實例
wx5c6f5798d627c
2019-02-23 13:16:33
PHP編程和調試環境
mapdll
2019-02-23 13:02:47
PHP開發工具PHP基礎教程
要不要晴天
2019-02-23 00:35:06
(PHP學習筆記)我對PHP變量引用、對象引用的理解
w1sw
2019-02-23 00:33:04
(PHP學習筆記)實現頁面靜態化
w1sw
2019-02-23 00:32:58
linux上安裝Docker(非常簡單的安裝方法)
幸運券發放
2019-02-24 19:38:01
阿里雲ACE認證之理解CDN技術
張嶸鑫
2019-02-24 10:57:10
HTML基礎及應用視頻教程
xyduan
2019-02-23 00:39:39