安裝 YAWS + ZF or CakePHP

edited 十月 2013 in 伺服器環境
YAWS 是以 Erlang 設計的網頁伺服器,據說...
利用 16 台 cluster server 所做的實驗,Yaws可以承受超過八萬個parallel session,Apache則在四千個就掛了。
http://ihower.idv.tw/blog/archives/1509

所以就想試試看這個東西,找著找著就看到這篇:
http://weblambdazero.blogspot.com/2008/08/php-zend-framework-on-yaws.html

看樣子是自行編譯方式安裝 YAWS ,我比較懶,所以在 Ubuntu 8.10 透過下面步驟搞定 CakePHP:
1. sudo su (非常糟的習慣...)
2. apt-get install yaws php5-cgi
3. 試著用瀏覽器打開 http://localhost:8080/ ,應該會看到預設畫面
4. cd /usr/lib/yaws/ebin
5. wget http://files.caldersoft.com/rewriter.erl
6. erlc rewriter.erl
7. pico /etc/yaws/conf.avail/localhost.conf
php_exe_path = /usr/bin/php-cgi
<server localhost>
    port = 8080
    listen = 0.0.0.0
    docroot = /usr/share/yaws
    # dir_listings = true
    allowed_scripts = yaws php html
    arg_rewrite_mod = rewriter
</server>

8. /etc/init.d/yaws restart

當然,預設的那個沒辦法直接使用在 CakePHP 上面,請把步驟 5 換成這篇文章的附加檔案

有些操作還是不太順,因為 CakePHP 沒有把 :8080 加進去表單送出位置,但勉強可以拿來試試 ^^

環境:
1. Ubuntu 8.10
2. Yaws 1.77
3. MySQL 5.0.67
4. PHP-CGI 5.2.6-2ubuntu4
5. CakePHP 1.2

原始討論: http://twpug.net/x/modules/newbb/viewtopic.php?topic_id=3868

評論

  • edited 一月 2009
    透過 siege -c 100 -r 3 直接在本機測試的結果不是很好看

    Apache + mod_php + APC
    Transactions: 300 hits
    Availability: 100.00 %
    Elapsed time: 52.70 secs
    Data transferred: 27.46 MB
    Response time: 16.08 secs
    Transaction rate: 5.69 trans/sec
    Throughput: 0.52 MB/sec
    Concurrency: 91.52
    Successful transactions: 300
    Failed transactions: 0
    Longest transaction: 27.95
    Shortest transaction: 1.69

    Yaws + php_cgi
    Transactions: 284 hits
    Availability: 94.67 %
    Elapsed time: 43.10 secs
    Data transferred: 24.78 MB
    Response time: 9.47 secs
    Transaction rate: 6.59 trans/sec
    Throughput: 0.57 MB/sec
    Concurrency: 62.40
    Successful transactions: 284
    Failed transactions: 16
    Longest transaction: 33.51
    Shortest transaction: 2.55

    Yaws + php_cgi + APC = 當機 ^^||

    還有太多未知領域,先測到這邊 ;)
Sign In or Register to comment.