{"id":169,"date":"2014-05-22T21:41:07","date_gmt":"2014-05-22T13:41:07","guid":{"rendered":"http:\/\/thephper.com\/?p=169"},"modified":"2014-05-22T21:42:53","modified_gmt":"2014-05-22T13:42:53","slug":"linux%e5%8d%95%e7%9b%ae%e5%bd%95%e6%96%87%e4%bb%b6%e4%b8%8d%e8%a6%81%e8%bf%87%e5%a4%9a%ef%bc%8c%e5%a4%9a%e5%b0%91%e6%98%af%e8%bf%87%e5%a4%9a%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/thephper.com\/?p=169","title":{"rendered":"linux\u5355\u76ee\u5f55\u6587\u4ef6\u4e0d\u8981\u8fc7\u591a\uff0c\u591a\u5c11\u662f\u8fc7\u591a\uff1f"},"content":{"rendered":"<p>\u6211\u4eec\u90fd\u77e5\u9053\u4e00\u4e2a\u6587\u4ef6\u5939\u6587\u4ef6\u4e0d\u5b9c\u8fc7\u591a\uff0c\u6587\u4ef6\u8fc7\u591a\uff0c\u4f1a\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d\uff0c\u90a3\u5230\u5e95\u600e\u6837\u7b97\u8fc7\u591a\u5462\uff1f<\/p>\n<p>\u4eca\u5929\u677f\u5b50\u51b3\u5b9a\u8e42\u8e8f\u4e0b\u81ea\u5df1\u7684\u65b0mac<\/p>\n<p>\u56e0\u672c\u6587\u65e8\u5728\u8ba8\u8bba\u76f8\u540c\u72b6\u6001\u4e0b\uff0c\u6027\u80fd\u968f\u5355\u76ee\u5f55\u6587\u4ef6\u6570\u91cf\u53d8\u5316\u800c\u53d1\u751f\u7684\u53d8\u5316\uff0c\u6240\u4ee5\u672a\u505a\u5176\u4ed6\u7279\u522b\u8bbe\u7f6e<\/p>\n<p>\u51c6\u5907\uff1a<br \/>\n    Mac Pro \uff08ssd\uff09\u4e00\u53f0 (\u5b89\u88c5ubuntu 12.04 \u865a\u62df\u673a LNMP \u73af\u5883)<br \/>\n    5\u4e2a\u6587\u4ef6\u5939\uff0c\u5404\u5206\u522b\u5305\u542b1w\u30015w\u300110w\u300150w\u3001100w\u4e2a\u540c\u6837\u5185\u5bb9\u5c0f\u6587\u4ef6<br \/>\n    \u538b\u6d4b\u547d\u4ee4\uff1aab -n 10000 -c 100 &#8216;http:\/\/s1.localhost.com\/files.php?num=xxx&#8217;<\/p>\n<p>    files.php\uff1a<\/p>\n<pre>\r\n$num = empty($_GET['num']) ? 10000 : $_GET['num'];\r\necho file_get_contents(\"\/..filepath..\/$num\/file_\".rand(1,$num));\r\n<\/pre>\n<p>\u4ee5\u4e0b\u662f\u6d4b\u8bd5\u7ed3\u679c\uff1a<\/p>\n<p><!--more--><br \/>\n1.1w\u4e2a\u6587\u4ef6<\/p>\n<pre>\r\n\r\nDocument Path:          \/files.php?num=10000\r\nDocument Length:        2 bytes\r\n\r\nConcurrency Level:      100\r\nTime taken for tests:   4.385 seconds\r\nComplete requests:      10000\r\nFailed requests:        0\r\nWrite errors:           0\r\nTotal transferred:      1500000 bytes\r\nHTML transferred:       20000 bytes\r\nRequests per second:    2280.35 [#\/sec] (mean)\r\nTime per request:       43.853 [ms] (mean)\r\nTime per request:       0.439 [ms] (mean, across all concurrent requests)\r\nTransfer rate:          334.04 [Kbytes\/sec] received\r\n\r\nConnection Times (ms)\r\n              min  mean[+\/-sd] median   max\r\nConnect:        0    0   0.4      0       6\r\nProcessing:     3   44   4.5     43      69\r\nWaiting:        3   43   4.5     43      69\r\nTotal:          9   44   4.3     43      69\r\n\r\nPercentage of the requests served within a certain time (ms)\r\n  50%     43\r\n  66%     44\r\n  75%     45\r\n  80%     46\r\n  90%     49\r\n  95%     52\r\n  98%     54\r\n  99%     56\r\n 100%     69 (longest request)\r\n<\/pre>\n<p>2. 5w\u4e2a\u5c0f\u6587\u4ef6<\/p>\n<pre>\r\nDocument Path:          \/files.php?num=50000\r\nDocument Length:        2 bytes\r\n\r\nConcurrency Level:      100\r\nTime taken for tests:   5.088 seconds\r\nComplete requests:      10000\r\nFailed requests:        0\r\nWrite errors:           0\r\nTotal transferred:      1500000 bytes\r\nHTML transferred:       20000 bytes\r\nRequests per second:    1965.44 [#\/sec] (mean)\r\nTime per request:       50.879 [ms] (mean)\r\nTime per request:       0.509 [ms] (mean, across all concurrent requests)\r\nTransfer rate:          287.91 [Kbytes\/sec] received\r\n\r\nConnection Times (ms)\r\n              min  mean[+\/-sd] median   max\r\nConnect:        0    0   0.4      0       4\r\nProcessing:     5   51   8.2     50     568\r\nWaiting:        5   50   8.2     50     568\r\nTotal:          9   51   8.2     50     569\r\n\r\nPercentage of the requests served within a certain time (ms)\r\n  50%     50\r\n  66%     51\r\n  75%     52\r\n  80%     53\r\n  90%     56\r\n  95%     58\r\n  98%     61\r\n  99%     62\r\n 100%    569 (longest request)\r\n<\/pre>\n<p>3. 10w\u4e2a\u5c0f\u6587\u4ef6<\/p>\n<pre>\r\nDocument Path:          \/files.php?num=100000\r\nDocument Length:        2 bytes\r\n\r\nConcurrency Level:      100\r\nTime taken for tests:   6.541 seconds\r\nComplete requests:      10000\r\nFailed requests:        0\r\nWrite errors:           0\r\nTotal transferred:      1500000 bytes\r\nHTML transferred:       20000 bytes\r\nRequests per second:    1528.79 [#\/sec] (mean)\r\nTime per request:       65.411 [ms] (mean)\r\nTime per request:       0.654 [ms] (mean, across all concurrent requests)\r\nTransfer rate:          223.94 [Kbytes\/sec] received\r\n\r\nConnection Times (ms)\r\n              min  mean[+\/-sd] median   max\r\nConnect:        0    0   0.5      0       6\r\nProcessing:    11   65  35.7     56    1076\r\nWaiting:       11   65  35.7     56    1076\r\nTotal:         17   65  35.9     56    1076\r\n\r\nPercentage of the requests served within a certain time (ms)\r\n  50%     56\r\n  66%     58\r\n  75%     60\r\n  80%     62\r\n  90%     69\r\n  95%    119\r\n  98%    212\r\n  99%    268\r\n 100%   1076 (longest request)\r\n<\/pre>\n<p>4. 50w\u4e2a\u5c0f\u6587\u4ef6<\/p>\n<pre>\r\nDocument Path:          \/files.php?num=500000\r\nDocument Length:        2 bytes\r\n\r\nConcurrency Level:      100\r\nTime taken for tests:   19.078 seconds\r\nComplete requests:      10000\r\nFailed requests:        0\r\nWrite errors:           0\r\nTotal transferred:      1500000 bytes\r\nHTML transferred:       20000 bytes\r\nRequests per second:    524.17 [#\/sec] (mean)\r\nTime per request:       190.776 [ms] (mean)\r\nTime per request:       1.908 [ms] (mean, across all concurrent requests)\r\nTransfer rate:          76.78 [Kbytes\/sec] received\r\n\r\nConnection Times (ms)\r\n              min  mean[+\/-sd] median   max\r\nConnect:        0    0   0.4      0       5\r\nProcessing:     9  190  72.0    180     672\r\nWaiting:        9  190  72.0    180     672\r\nTotal:         13  190  72.0    180     672\r\n\r\nPercentage of the requests served within a certain time (ms)\r\n  50%    180\r\n  66%    216\r\n  75%    236\r\n  80%    248\r\n  90%    280\r\n  95%    304\r\n  98%    334\r\n  99%    508\r\n 100%    672 (longest request)\r\n<\/pre>\n<p>5.100w\u4e2a\u5c0f\u6587\u4ef6<\/p>\n<pre>\r\nDocument Path:          \/files.php?num=1000000\r\nDocument Length:        2 bytes\r\n\r\nConcurrency Level:      100\r\nTime taken for tests:   40.261 seconds\r\nComplete requests:      10000\r\nFailed requests:        0\r\nWrite errors:           0\r\nTotal transferred:      1500000 bytes\r\nHTML transferred:       20000 bytes\r\nRequests per second:    248.38 [#\/sec] (mean)\r\nTime per request:       402.614 [ms] (mean)\r\nTime per request:       4.026 [ms] (mean, across all concurrent requests)\r\nTransfer rate:          36.38 [Kbytes\/sec] received\r\n\r\nConnection Times (ms)\r\n              min  mean[+\/-sd] median   max\r\nConnect:        0    0   0.7      0       9\r\nProcessing:    24  401  91.3    407     726\r\nWaiting:       23  401  91.3    407     726\r\nTotal:         29  401  91.3    407     726\r\n\r\nPercentage of the requests served within a certain time (ms)\r\n  50%    407\r\n  66%    440\r\n  75%    461\r\n  80%    475\r\n  90%    512\r\n  95%    543\r\n  98%    592\r\n  99%    620\r\n 100%    726 (longest request)\r\n<\/pre>\n<p>\u7ed3\u8bba\uff1a\u81ea\u884c\u53c2\u8003\u7ed3\u679c\u5427\uff0c\u8981\u6211\u8bf4\u7684\u8bdd\uff0c\u4ee51w\u4e3a\u9650\u5427<\/p>\n<p>\u4ec0\u4e48\uff1f\u4f60\u6ca1\u6cd5\u5728\u4e00\u4e2a\u76ee\u5f55\u521b\u5efa100w\u4e2a\u6587\u4ef6\uff1f\u90a3\u662f\u53e6\u5916\u4e00\u4e2a\u8bdd\u9898\u4e86\uff0c\u8bf7\u81ea\u884cgoogle\uff1a linux inode<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u4eec\u90fd\u77e5\u9053\u4e00\u4e2a\u6587\u4ef6\u5939\u6587\u4ef6\u4e0d\u5b9c\u8fc7\u591a\uff0c\u6587\u4ef6\u8fc7\u591a\uff0c\u4f1a\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d\uff0c\u90a3\u5230\u5e95\u600e\u6837\u7b97\u8fc7\u591a\u5462\uff1f &hellip; <a href=\"https:\/\/thephper.com\/?p=169\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[26],"tags":[38,37,39],"_links":{"self":[{"href":"https:\/\/thephper.com\/index.php?rest_route=\/wp\/v2\/posts\/169"}],"collection":[{"href":"https:\/\/thephper.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thephper.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thephper.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thephper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=169"}],"version-history":[{"count":19,"href":"https:\/\/thephper.com\/index.php?rest_route=\/wp\/v2\/posts\/169\/revisions"}],"predecessor-version":[{"id":189,"href":"https:\/\/thephper.com\/index.php?rest_route=\/wp\/v2\/posts\/169\/revisions\/189"}],"wp:attachment":[{"href":"https:\/\/thephper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thephper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thephper.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}