Ruby 板


LINE

最近收了一堆信,信箱整個爆,來賺 p 幣買信箱... @@ : → ryudo:thin可靠嗎?我沒啥聽說有production的站在用 10/15 18 根據我之前的經驗,thin 沒有 mongrel 穩,mongrel 算是經過考驗的。 但是 thin 比 mongrel 快很多很多很多... 基本上我會建議用 thin, 除非你碰到不穩的問題,才考慮換 mongrel. heroku: http://heroku.com/ rails/rack hosting, 他們的 dyno 是用 thin 去改的。 根據他們的說法是,比 mongrel 快,比 mongrel 小,比 mongrel 穩。 我自己的經驗是比 mongrel 快很多很多,但其他的不見得。 另外很重要的是,mongrel 沒有直接支援 rack, 啟動 script 也不是很好用。這點 thin 也是大勝 mongrel. 不過我覺得這都是因為 mongrel 後來沒在發展了.... 如果 mongrel 繼續發展,不會輸 thin. 但現在我會說 mongrel 輸給 thin 不少。 : → ryudo:unicorn還是第一次聽到 10/15 18 這滿新的,作者是 Eric Wong, 是 mogilefs-client 的作者。 程式寫得相當漂亮,簡潔俐落,設計則是參考 UNIX/POSIX 的作法。 很明顯這不能用在 windows 上 XD 可以參考這頁: http://tomayko.com/writings/unicorn-is-unix 這邊則是一些設計上的考量: http://unicorn.bogomips.org/DESIGN.html http://unicorn.bogomips.org/PHILOSOPHY.html 好,我知道大家都很懶,不想自己看 XD 正好我今天大概看了一下。 簡單地說,unicorn 遵循 UNIX philosophy: 1. Write programs that do one thing and do it well. 2. Write programs to work together. 3. Write programs to handle text streams, because that is a universal interface. unicorn 不企圖做到每件事,他只對付快速的 client, 不做 buffer. 所以前端會需要有一個 reverse proxy, 例如 nginx. 你要用 apache 也不是不行啦,但就我所知沒什麼人在用 apache... 我指做這些事情。每個地方都在講 apache bloat bloat bloat, slow slow slow... memory leak leak leak... 他就只是很方便而已。 除此之外就是用 shared socket, select (or epoll?), 還有 prefork. 而慢速的 client? 用 Rainbows! 對付 http://rainbows.rubyforge.org/ 這是從 unicorn 切出來的。 我個人是覺得跟 passenger 架構有一點類似,只是 passenger 是整個包成一包, 但 unicorn 則是把最重要的核心拆出來。程式碼也很少,除了 http parser 外, 全部都是 ruby 寫成。http parser 是用 mongrel 的,用 ragel 寫,產生 c 程式 再去 compile 的。ragel 是 parser generator, 最近應該也滿流行的。 參考這篇留言: http://github.com/blog/517-unicorn#comment_3142 Now don't get me wrong, Passenger is great. Point it at your app and for the most part your are done. But if you need it to do something different, it's fairly inflexible, and it's here, I think, that Unicorn really shines. 當你想做點什麼手腳時,passenger 沒有這樣的空間讓你動; 然而 unicorn 只有最核心的部份,而且全部是 ruby, 你隨時可以改變什麼。 我覺得 unicorn 相當值得一試,雖然短時間內可能還是繼續用 passenger. 原因很簡單,目前我不需要對 passenger 動手腳 :p 而且針對 passenger 的 script 都寫好了,沒有重大問題前,也不用特別去換 但如果碰到什麼問題,我第一個決定試的肯定是 unicorn. 他沒什麼新東西,都是過去已知的概念,但我個人覺得是個突破。 就像 rails 其實也沒有什麼新東西,一個個看都沒什麼,放在一起就厲害了。 : → ryudo:passenger for nginx有比apache版好嗎? 10/15 18 核心是一樣的,所以這個問題近似 nginx 有比 apache 好嗎? 我會說這是肯定的。然 apache 好的地方在於他是老牌,工具很多, 文件很多,問題也都是已知的,所以你可以想辦法避開。 nginx 相較之下年輕很多,一開始又只有俄國人用,英文文件很少。 不過也許他們放在一起比較是不太公平的,畢竟 apache 是萬能型的, 他幾乎什麼都有... nginx 也沒有 mod_php, 你只能用 fast-cgi. 也有人說,如果你有 fast-cgi, 何必用 mod_php? 不過 apache mod_php 似乎做得非常好,足以跟 fast-cgi 相較, 而且用起來也比 fast-cgi 方便得多。 但跟 lighttpd 比較就很明顯了。lighttpd 發展近幾年太過遲緩, nginx 又快速蓬勃發展,使用者量早已超越 lighttpd 一大截了... 小、快、穩,nginx 大概是這幾個優點,可以取代 lighttpd, 但功能上並不容易取代 apache, 如果你需要很多 apache 的功能。 你要跑 php 的話可能還是用 apache 比較「方便」就是了。 否則 nginx 真的是好太多的選擇。 passenger 不支援 nginx 的話,我不會考慮 passenger, 會繼續使用 thin cluster (用了一陣子) -- #!/usr/bin/env ruby [露比] /Programming (Kn|N)ight/ 看板《Ruby》 # if a dog nailed extra legs that http://webptt.com/m.aspx?n=bbs/Ruby/index.html # walks like an octopus, and Welcome ~Ruby@ptt~ # talks like an octopus, then ◢█◣ http://www.ruby-lang.org/ # we are happy to treat it as http://www.ruby-doc.org/ # if it were an octopus. http://www.rubyforge.org/ --



※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.135.28.18
1F:→ ryudo:要多寫額外的init script是最不能接受之處 10/19 14:24
2F:→ godfat:哪一個 init script? 10/19 14:27
3F:→ ryudo:mongrel或thin要啟動不是都要自己寫init script? 10/19 14:40
4F:→ godfat:寫 config 就可以了啊.. 10/19 14:53
5F:→ ryudo:nginx可以不用額外寫mongrel cluster的init script? 10/19 15:02
6F:→ godfat:nginx+passenger就nginx config,thin/mongrel也是config可 10/19 15:34
7F:→ ryudo:nginx+php(fastcgi)的話呢? 10/19 16:29
8F:→ godfat:php 的 fast-cgi 就是另一回事了,那跟 nginx 沒直接關係 10/19 16:43







like.gif 您可能會有興趣的文章
icon.png[問題/行為] 貓晚上進房間會不會有憋尿問題
icon.pngRe: [閒聊] 選了錯誤的女孩成為魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一張
icon.png[心得] EMS高領長版毛衣.墨小樓MC1002
icon.png[分享] 丹龍隔熱紙GE55+33+22
icon.png[問題] 清洗洗衣機
icon.png[尋物] 窗台下的空間
icon.png[閒聊] 双極の女神1 木魔爵
icon.png[售車] 新竹 1997 march 1297cc 白色 四門
icon.png[討論] 能從照片感受到攝影者心情嗎
icon.png[狂賀] 賀賀賀賀 賀!島村卯月!總選舉NO.1
icon.png[難過] 羨慕白皮膚的女生
icon.png閱讀文章
icon.png[黑特]
icon.png[問題] SBK S1安裝於安全帽位置
icon.png[分享] 舊woo100絕版開箱!!
icon.pngRe: [無言] 關於小包衛生紙
icon.png[開箱] E5-2683V3 RX480Strix 快睿C1 簡單測試
icon.png[心得] 蒼の海賊龍 地獄 執行者16PT
icon.png[售車] 1999年Virage iO 1.8EXi
icon.png[心得] 挑戰33 LV10 獅子座pt solo
icon.png[閒聊] 手把手教你不被桶之新手主購教學
icon.png[分享] Civic Type R 量產版官方照無預警流出
icon.png[售車] Golf 4 2.0 銀色 自排
icon.png[出售] Graco提籃汽座(有底座)2000元誠可議
icon.png[問題] 請問補牙材質掉了還能再補嗎?(台中半年內
icon.png[問題] 44th 單曲 生寫竟然都給重複的啊啊!
icon.png[心得] 華南紅卡/icash 核卡
icon.png[問題] 拔牙矯正這樣正常嗎
icon.png[贈送] 老莫高業 初業 102年版
icon.png[情報] 三大行動支付 本季掀戰火
icon.png[寶寶] 博客來Amos水蠟筆5/1特價五折
icon.pngRe: [心得] 新鮮人一些面試分享
icon.png[心得] 蒼の海賊龍 地獄 麒麟25PT
icon.pngRe: [閒聊] (君の名は。雷慎入) 君名二創漫畫翻譯
icon.pngRe: [閒聊] OGN中場影片:失蹤人口局 (英文字幕)
icon.png[問題] 台灣大哥大4G訊號差
icon.png[出售] [全國]全新千尋侘草LED燈, 水草

請輸入看板名稱,例如:e-shopping站內搜尋

TOP