How slow is MyBookWorld

以前只是觉得 MyBookWorld 慢,但也没关心究竟有多慢,今天实测了一下,单个大文件读速率 4.9 MB/s,写速率 3.8 MB/s。这么糟糕的成绩,大概得归咎于 CPU 能力太差。我测的是 MyBookWorld I 版,不知带 Raid 双硬盘配置的 MyBookWorld II 是否使用了更好的芯片,如果同种芯片,II 版不会有比 I 版更好的成绩。

Difference of try_files to rewrite in Nginx

try_files 是 Nginx 自0.6.36 新增的 directive。通常对 try_files 的理解是——它是 if (!-e $request_filename) { rewrite .* /index.php; } 的更简洁的表达。但我发现它们之间还是略有区别,主要表现在两点: 如使用 rewrite,Nginx 要求 document_root 下必须有一个 index 文件,即使我把另一个目录别名整个 document_root,但因为 Nginx 先校验 document_root 下是否有一个 index 文件,所以得放置一个空 index 文件。try_files 则没有 index 文件校验,直接去第二、第三… document_root 找对应的文件。 如使用 try_files $uri $uri/ /index.php,index.php 不能取得 get 变量,例如在 Magento 下,对 http://mydomain/catalogname?mode=list 的访问不能起效,Nginx 交付的页面是 http://mydomain/catalogname。这时必须使用 rewrite。这或许是 try_files 的一个… Continue reading Difference of try_files to rewrite in Nginx