我可以将应用程序代码放在RAM中的分区上吗?

时间:2012-11-13 11:12:56

标签: linux testing ram ssd

我想使用RAM而不是SSD。我正在寻找有经验的人给我一些建议。我想挂载一个分区并将其放入我的Rails应用程序。

有什么想法吗?

UPD:我测试了SSD和RAM。我有一个OSX,4x4Gb金士顿@ 1333内存,英特尔酷睿i3 @ 2,8 Ghz,OCZ Vertex3 @ 120Gb,硬盘希捷ST3000DM001 @ 3Tb。我的操作系统安装在SSD和ruby上,宝石放在SSD的主文件夹中。我在sqlite中创建了包含10.000个产品项的新Rails应用程序,并使用代码创建控制器:

@products = Product.all
Rails.cache.clear

用AB测试。

SSD

Document Length:        719 bytes
Concurrency Level:      4
Time taken for tests:   39.274 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      130600 bytes
HTML transferred:       71900 bytes
Requests per second:    2546.21
Transfer rate:          3325.35 kb/s received
Connnection Times (ms)
            min     avg     max
Connect:    0       0       0
Processing: 398     1546    1627
Total:      398     1546    1627

RAM

Document Length:        719 bytes
Concurrency Level:      4
Time taken for tests:   39.272 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      130600 bytes
HTML transferred:       71900 bytes
Requests per second:    2546.33
Transfer rate:          3325.51 kb/s received
Connnection Times (ms)
            min     avg     max
Connect:    0       0       0
Processing: 366     1546    1645
Total:      366     1546    1645

HDD

Document Length:        719 bytes
Concurrency Level:      4
Time taken for tests:   40.510 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      130600 bytes
HTML transferred:       71900 bytes
Requests per second:    2468.54
Transfer rate:          3223.92 kb/s received
Connnection Times (ms)
            min     avg     max
Connect:    0       0       0
Processing: 1193    1596    2400
Total:      1193    1596    2400

所以,我认为在ruby中使用gems放置在SSD上并缓慢地获取这些脚本,我将在真实服务器上进行测试,并将所有ruby脚本放入具有更复杂代码或实际应用程序的RAM中。

ps:对不起我的英语:)

0 个答案:

没有答案