查看積分策略說明發表回覆
Discuz! 代碼
提示插入
直接插入
說明訊息

插入粗體文本 插入斜體文本 插入下劃線 置中對齊 插入超級連結 插入信件位址 插入圖像 插入 flash 插入代碼 插入引言 插入列表
刪除線 直線分隔線 虛線分隔線
    
添加文字底框
內容 [字數檢查]:

表情符號

更多 Smilies
字型大小 |||
溫馨提示:本區開放遊客瀏覽。


文章關鍵字 : [功能說明]
(關鍵字可加強搜索準確性, 如關鍵字多於一組, 請以 , 作分隔, e.g. : 阿笨,shiuh,第一笨)

 關閉 URL 識別 | html 禁用
 關閉 表情符號 | 表情符號 可用
 關閉 Discuz! 代碼 | Discuz! 代碼 可用
使用個人簽名
接收新回覆信件通知
推薦放檔網絡空間

檔案(Torent, zip等)
  1. freedl
  2. multiupload
  3. btghost
  4. 便當狗
  5. mediafire
  6. pillowangel
圖片(JPG, GIF等)
  1. hotimg
  2. tinypic
  3. mousems2
  4. imageshack
  5. imm.io
>>>歡迎推薦好用空間


最新10篇文章回顧
Vic

 發表於 2011-4-5 11:03 PM

index.php一開始有設定(否則論壇也運作不起)…不過沒有放到最前就是了~ (雖然放到第2…當時沒想到效率有差)

怕有人跟熊一樣笨…就提醒一下…害dayi兄無言真是罪過罪過。


dayi

 發表於 2011-4-5 10:56 PM

~突然有點無言
這個不是一開始就要先設定好的嗎
(公然吐熊小的嘈~熊小別砍我~~~逃)


Vic

 發表於 2011-4-5 10:34 PM

剛才在看一個有關php的talk slide時,發現一個簡單優化php於Apache存取效率的方法。

也許有朋友已經很早就知道了~ 不過熊小真的沒想過這有分別…(果然是要多多看多多學)

於apache setting file內 (e.g. /etc/httpd/conf/httpd.conf)


<Directory /var/www>
    DirectoryIndex index.htm index.html
</Directory>


改成
<Directory /var/www>
    DirectoryIndex index.php index.htm index.html
</Directory>

重點是index.php必須加到最前 (熊小之前是加到htm與html之間), 如果是cgi, pl其實都一樣,加到最前。令apache最先存取。


原理
strace your web server process
% /usr/sbin/apache2 -X &
[1] 16367
(hit page a few times to warm up caches)
% strace -p 16367 -o sys1.txt
Process 16367 attached - interrupt to quit
(hit page once)
Process 16367 detached
% grep stat sys1.txt | grep -v fstat | wc -l
153


Common Mistake
stat64("/var/www/index.html", 0xbfd279ac) = -1 ENOENT (No such file or directory)
stat64("/var/www/index.cgi", 0xbfd27afc) = -1 ENOENT (No such file or directory)
stat64("/var/www/index.pl", 0xbfd27afc) = -1 ENOENT (No such file or directory)
stat64("/var/www/index.php", {st_mode=S_IFREG|0664, st_size=7198, ...}) = 0





所在時區為 GMT+8, 現在時間是 2024-5-6 06:49 AM
清除 Cookies - 連絡我們 - TWed2k © 2001-2046 - 純文字版 - 說明
Discuz! 0.1 | Processed in 0.018366 second(s), 7 queries , Qzip disabled