Site Tools


ramdisk

Файлы в RAM существуют, пока существет электричество в RAM

  • RAMDisk позиционируется как кэш, и если ОС-кэш 95% и Вы добавите в RAMDisk 6%, то память пойдет в свам а не на очистку ОС-кэша. Очищаем ОС-Кэш: echo 3 > /proc/sys/vm/drop_caches

Linux

tmpfs
  • Память выделяется по факту записи #Монтируя гигабайт, гигабайт из памяти не уходит. Уходит только при создание файла в tmpfs
  • Монтируйется любой объем. При заполнение памяти, используется своп винча. При заполнение свапа винча идет убийство програм и сервер “колбасит”
  • Вероятно, в систему уже смонтированы /dev/shm /var/run /var/lock . Смотрим mount|grep tmpfs

Создаем:

# mount -t tmpfs -o size=100M tmpfs /mnt/tmpfs/

Меняем размер:

# mount -o remount,size=2G /mnt/tmpfs

Посстоянное монтирование В /etc/fstab

none /media/ramdisk tmpfs defaults,user,size=1G,mode=0777 0 0
ramfs
  • ramfs в отличие от tmpfs не использует своп винчестера. Но от падение в случае заполнение памяти это не спасает

Создаем:

# mount -t ramfs none /mnt/ram

Создаем образ с ramfs и ограниченным размером:

# dd if=/dev/zero of=/root/RAMDisk.img bs=1024 count=1024  # Создаем файл в 1024*1024 (1 мегабайт)
# mke2fs -vFL RAMDisk /root/RAMDisk.img                    # Создаем FileSistyem RAMDisk в файле
# mkdir -p /mnt/RAMISO                                    # Создаем папку для монтирования
# mount -o loop /root/RAMDisk.img /mnt/RAMISO             # Монтируем loop устройство /mnt/ram/disk.img в нашу папку.

Говорят, можно mount -t ramfs -omaxsize=256M none /mnt1 но у меня на Ubuntu и CentOS не сработало.

FreeBSD

MD

Запускаем сервисы

Хочется хранить базы данных и другие сильно загруженные файлы в RAMDisk, но нельзя допустить потерю данных в случае перезагрузки

Используем скрипт копирования
#!/bin/sh
#/etc/init.d/ramdisk_to_archive.sh
a=$(date +%T-%d-%m-%Y)

mkdir /ramdisk_archives/$a
cp -i -p -R /media/ramdisk/* /ramdisk_archives/$a
rm /ramdisk_archives/latest
ln -s /ramdisk_archives/$a /ramdisk_archives/latest
Копируем img
Тот же скрипт с копирование, но можно копировать не по файлово, а образ который мы можем использовать в примере с ramfs и его ограничением по размеру.
Размещать TMP файлы сервисов
  • MySQL: В my.cnf директива tmpdir =

Запускаем ОС из RAM

запускаем?

Other

Скорость работы

Тестирование на VPS сервере показало странные результата, по видимому связанные с работой памяти виртуальных машин. На домашнем ПК результаты более стабильны.

HomePC

Запись

В RAM:

root@home:/tmp# dd if=/dev/zero of=/var/run/test.txt bs=1M count=50
52428800 bytes (52 MB) copied, 0.123813 s, 423 MB/s

В HDD:

root@home:/tmp# dd if=/dev/zero of=/root/test.txt bs=1M count=50
52428800 bytes (52 MB) copied, 0.214215 s, 245 MB/s
Чтение

Из RAM:

root@home:/tmp# dd if=/var/run/InfoSec_Course1-3.rar of=/dev/null 
1030128402 bytes (1.0 GB) copied, 4.8071 s, 214 MB/s

Из HDD:

root@home:/tmp# dd if=/home/konovalov/Downloads/InfoSec_Course1-3.rar of=/dev/null 
1030128402 bytes (1.0 GB) copied, 8.50211 s, 121 MB/s

На VPS

Запись

В RAM:

# dd if=/dev/zero of=/dev/shm/test.txt bs=1M count=50
52428800 bytes (52 MB) copied, 0.51142 s, 103 MB/s
# dd if=/dev/zero of=/mnt/tmpfs/test.txt bs=1M count=50
52428800 bytes (52 MB) copied, 0.258744 s, 203 MB/s

В HDD:

# dd if=/dev/zero of=/root/test.txt bs=1M count=50
52428800 bytes (52 MB) copied, 0.176399 s, 297 MB/s
# dd if=/dev/zero of=/root/test2.txt bs=1M count=50
52428800 bytes (52 MB) copied, 0.0979351 s, 535 MB/s
Чтение

Из RAM:

# dd if=/mnt/tmpfs/site.ru.access.log.tar.gz of=/dev/null 
519604045 bytes (520 MB) copied, 3.42652 s, 152 MB/s

Из HDD:

# dd if=/root/site.ru.access.log.tar.gz of=/dev/null 
519604045 bytes (520 MB) copied, 4.7923 s, 108 MB/s

MySQL Bench

Общая суть: RamDisk особо не дает увеличение скорости на select и insert. Но, при create большая разница в скорости работы. Хотя create очень редко выполняется в базах данных. Так что, использование RamDisk для баз данных сомнительно.

HomePC

C RAM:

root@home:~/tmp/mysql-5.1-5.1.54/sql-bench# perl run-all-tests  --user='root' --password='password'
Benchmark DBD suite: 2.15
Date of test:        2011-11-23 19:11:39
Running tests on:    Linux 2.6.38-12-generic i686
Arguments:           
Comments:            
Limits from:         
Server version:      MySQL 5.1.54 1ubuntu4
Optimization:        None
Hardware:            

alter-table: Total time: 10 wallclock secs ( 0.08 usr  0.01 sys +  0.00 cusr  0.00 csys =  0.09 CPU)
ATIS: Total time:  6 wallclock secs ( 4.44 usr  0.36 sys +  0.00 cusr  0.00 csys =  4.80 CPU)
big-tables: Total time:  7 wallclock secs ( 3.17 usr  0.40 sys +  0.00 cusr  0.00 csys =  3.57 CPU)
connect: Total time: 113 wallclock secs (38.10 usr 18.13 sys +  0.00 cusr  0.00 csys = 56.23 CPU)
create: Total time: 87 wallclock secs ( 4.85 usr  2.13 sys +  0.00 cusr  0.00 csys =  6.98 CPU)
insert: Total time: 905 wallclock secs (344.68 usr 64.02 sys +  0.00 cusr  0.00 csys = 408.70 CPU)
select: Total time: 90 wallclock secs (27.23 usr  3.69 sys +  0.00 cusr  0.00 csys = 30.92 CPU)
transactions: Test skipped because the database doesn't support transactions
wisconsin: Total time:  6 wallclock secs ( 2.45 usr  0.83 sys +  0.00 cusr  0.00 csys =  3.28 CPU)

All 9 test executed successfully

Totals per operation:
Operation             seconds     usr     sys     cpu   tests
alter_table_add                        4.00    0.02    0.00    0.02     100 
alter_table_drop                       4.00    0.02    0.00    0.02      91 
connect                                7.00    4.17    1.06    5.23   10000 
connect+select_1_row                  10.00    4.94    1.40    6.34   10000 
connect+select_simple                  8.00    4.70    1.18    5.88   10000 
count                                  8.00    0.03    0.00    0.03     100 
count_distinct                         1.00    0.12    0.03    0.15    1000 
count_distinct_2                       0.00    0.14    0.02    0.16    1000 
count_distinct_big                     5.00    3.64    0.02    3.66     120 
count_distinct_group                   0.00    0.50    0.01    0.51    1000 
count_distinct_group_on_key            0.00    0.14    0.02    0.16    1000 
count_distinct_group_on_key_parts      1.00    0.49    0.03    0.52    1000 
count_distinct_key_prefix              0.00    0.13    0.02    0.15    1000 
count_group_on_key_parts               0.00    0.45    0.05    0.50    1000 
count_on_key                          18.00    5.97    1.06    7.03   50100 
create+drop                            8.00    1.11    0.58    1.69   10000 
create_MANY_tables                    46.00    1.23    0.27    1.50   10000 
create_index                           1.00    0.00    0.00    0.00       8 
create_key+drop                       13.00    1.46    0.58    2.04   10000 
create_table                           0.00    0.01    0.00    0.01      31 
delete_all_many_keys                  23.00    0.02    0.00    0.02       1 
delete_big                             0.00    0.00    0.00    0.00       1 
delete_big_many_keys                  23.00    0.02    0.00    0.02     128 
delete_key                             1.00    0.31    0.28    0.59   10000 
delete_range                           6.00    0.00    0.00    0.00      12 
drop_index                             1.00    0.00    0.00    0.00       8 
drop_table                             0.00    0.00    0.00    0.00      28 
drop_table_when_MANY_tables            2.00    0.27    0.29    0.56   10000 
insert                                50.00   12.37    8.91   21.28  350768 
insert_duplicates                     14.00    4.13    2.53    6.66  100000 
insert_key                            37.00    7.63    2.12    9.75  100000 
insert_many_fields                     3.00    0.21    0.05    0.26    2000 
insert_select_1_key                    2.00    0.00    0.00    0.00       1 
insert_select_2_keys                   3.00    0.00    0.00    0.00       1 
min_max                                4.00    0.01    0.00    0.01      60 
min_max_on_key                        15.00   10.12    2.02   12.14   85000 
multiple_value_insert                  2.00    0.26    0.01    0.27  100000 
once_prepared_select                  31.00    7.81    2.81   10.62  100000 
order_by_big                          15.00   10.89    0.13   11.02      10 
order_by_big_key                      14.00   11.34    0.00   11.34      10 
order_by_big_key2                     13.00   10.39    0.11   10.50      10 
order_by_big_key_desc                 14.00   11.25    0.00   11.25      10 
order_by_big_key_diff                 13.00   10.67    0.10   10.77      10 
order_by_big_key_prefix               13.00   10.45    0.00   10.45      10 
order_by_key2_diff                     2.00    0.98    0.01    0.99     500 
order_by_key_prefix                    1.00    0.53    0.02    0.55     500 
order_by_range                         2.00    0.53    0.03    0.56     500 
outer_join                             2.00    0.01    0.00    0.01      10 
outer_join_found                       2.00    0.00    0.00    0.00      10 
outer_join_not_found                   2.00    0.00    0.00    0.00     500 
outer_join_on_key                      2.00    0.00    0.00    0.00      10 
prepared_select                       40.00   15.56    2.66   18.22  100000 
select_1_row                          18.00    4.04    2.28    6.32  100000 
select_1_row_cache                     7.00    3.35    2.05    5.40  100000 
select_2_rows                         20.00    4.13    2.41    6.54  100000 
select_big                            13.00   10.74    0.00   10.74      80 
select_big_str                         7.00    2.82    0.88    3.70   10000 
select_cache                           1.00    1.11    0.24    1.35   10000 
select_cache2                         55.00    1.80    0.31    2.11   10000 
select_column+column                  19.00    3.77    2.48    6.25  100000 
select_diff_key                        0.00    0.11    0.00    0.11     500 
select_distinct                        1.00    0.83    0.03    0.86     800 
select_group                           2.00    0.65    0.07    0.72    2911 
select_group_when_MANY_tables         18.00    0.78    0.41    1.19   10000 
select_join                            0.00    0.24    0.00    0.24     100 
select_key                            71.00   31.68    5.37   37.05  200000 
select_key2                           77.00   32.46    5.69   38.15  200000 
select_key2_return_key                72.00   31.29    5.35   36.64  200000 
select_key2_return_prim               75.00   31.52    5.81   37.33  200000 
select_key_prefix                     77.00   32.32    5.71   38.03  200000 
select_key_prefix_join                 2.00    2.00    0.01    2.01     100 
select_key_return_key                 68.00   31.07    5.32   36.39  200000 
select_many_fields                     4.00    2.95    0.35    3.30    2000 
select_range                           6.00    4.15    0.04    4.19     410 
select_range_key2                      3.00    2.61    0.31    2.92   25010 
select_range_prefix                    4.00    2.57    0.35    2.92   25010 
select_simple                          9.00    3.24    2.04    5.28  100000 
select_simple_cache                    8.00    2.94    2.34    5.28  100000 
select_simple_join                     0.00    0.29    0.01    0.30     500 
update_big                            17.00    0.00    0.00    0.00      10 
update_of_key                         10.00    2.05    1.32    3.37   50000 
update_of_key_big                     10.00    0.03    0.02    0.05     501 
update_of_primary_key_many_keys       11.00    0.02    0.01    0.03     256 
update_with_key                       51.00   11.10    7.09   18.19  300000 
update_with_key_prefix                18.00    5.14    2.69    7.83  100000 
wisc_benchmark                         1.00    1.32    0.04    1.36     114 
TOTALS                              1241.00  420.15   89.44  509.59 3425950 

С HDD:

root@home:~/tmp/mysql-5.1-5.1.54/sql-bench# perl run-all-tests  --user='root' --password='password'
Benchmark DBD suite: 2.15
Date of test:        2011-11-23 17:54:11
Running tests on:    Linux 2.6.38-12-generic i686
Arguments:           
Comments:            
Limits from:         
Server version:      MySQL 5.1.54 1ubuntu4
Optimization:        None
Hardware:            

alter-table: Total time: 18 wallclock secs ( 0.06 usr  0.04 sys +  0.00 cusr  0.00 csys =  0.10 CPU)
ATIS: Total time:  6 wallclock secs ( 4.58 usr  0.28 sys +  0.00 cusr  0.00 csys =  4.86 CPU)
big-tables: Total time:  6 wallclock secs ( 3.09 usr  0.44 sys +  0.00 cusr  0.00 csys =  3.53 CPU)
connect: Total time: 115 wallclock secs (39.04 usr 17.97 sys +  0.00 cusr  0.00 csys = 57.01 CPU)
create: Total time: 1593 wallclock secs ( 5.48 usr  2.27 sys +  0.00 cusr  0.00 csys =  7.75 CPU)
insert: Total time: 901 wallclock secs (338.71 usr 64.28 sys +  0.00 cusr  0.00 csys = 402.99 CPU)
select: Total time: 91 wallclock secs (27.27 usr  3.84 sys +  0.00 cusr  0.00 csys = 31.11 CPU)
transactions: Test skipped because the database doesn't support transactions
wisconsin: Total time:  6 wallclock secs ( 2.40 usr  0.70 sys +  0.00 cusr  0.00 csys =  3.10 CPU)

All 9 test executed successfully

Totals per operation:
Operation             seconds     usr     sys     cpu   tests
alter_table_add                        7.00    0.02    0.01    0.03     100 
alter_table_drop                       8.00    0.01    0.00    0.01      91 
connect                                7.00    4.34    1.07    5.41   10000 
connect+select_1_row                   9.00    5.24    1.23    6.47   10000 
connect+select_simple                  8.00    4.68    1.39    6.07   10000 
count                                  8.00    0.02    0.02    0.04     100 
count_distinct                         0.00    0.14    0.01    0.15    1000 
count_distinct_2                       1.00    0.14    0.02    0.16    1000 
count_distinct_big                     5.00    3.67    0.03    3.70     120 
count_distinct_group                   1.00    0.51    0.02    0.53    1000 
count_distinct_group_on_key            0.00    0.14    0.03    0.17    1000 
count_distinct_group_on_key_parts      0.00    0.50    0.03    0.53    1000 
count_distinct_key_prefix              0.00    0.14    0.02    0.16    1000 
count_group_on_key_parts               0.00    0.50    0.00    0.50    1000 
count_on_key                          18.00    5.94    1.17    7.11   50100 
create+drop                          602.00    1.62    0.65    2.27   10000 
create_MANY_tables                   344.00    1.09    0.45    1.54   10000 
create_index                           1.00    0.00    0.00    0.00       8 
create_key+drop                      640.00    1.93    0.63    2.56   10000 
create_table                           1.00    0.01    0.00    0.01      31 
delete_all_many_keys                  21.00    0.01    0.00    0.01       1 
delete_big                             0.00    0.00    0.00    0.00       1 
delete_big_many_keys                  21.00    0.01    0.00    0.01     128 
delete_key                             2.00    0.32    0.28    0.60   10000 
delete_range                           5.00    0.00    0.00    0.00      12 
drop_index                             1.00    0.00    0.00    0.00       8 
drop_table                             0.00    0.01    0.00    0.01      28 
drop_table_when_MANY_tables            3.00    0.30    0.27    0.57   10000 
insert                                50.00   12.34    9.08   21.42  350768 
insert_duplicates                     14.00    4.30    2.45    6.75  100000 
insert_key                            39.00    7.73    2.23    9.96  100000 
insert_many_fields                     3.00    0.22    0.06    0.28    2000 
insert_select_1_key                    2.00    0.00    0.00    0.00       1 
insert_select_2_keys                   3.00    0.00    0.00    0.00       1 
min_max                                3.00    0.02    0.00    0.02      60 
min_max_on_key                        17.00   10.11    1.98   12.09   85000 
multiple_value_insert                  1.00    0.26    0.01    0.27  100000 
once_prepared_select                  30.00    7.48    2.60   10.08  100000 
order_by_big                          15.00   10.57    0.11   10.68      10 
order_by_big_key                      13.00   11.04    0.04   11.08      10 
order_by_big_key2                     12.00   10.25    0.11   10.36      10 
order_by_big_key_desc                 14.00   10.87    0.12   10.99      10 
order_by_big_key_diff                 14.00   10.63    0.08   10.71      10 
order_by_big_key_prefix               13.00   10.48    0.05   10.53      10 
order_by_key2_diff                     2.00    1.03    0.00    1.03     500 
order_by_key_prefix                    2.00    0.57    0.01    0.58     500 
order_by_range                         1.00    0.55    0.02    0.57     500 
outer_join                             2.00    0.00    0.00    0.00      10 
outer_join_found                       3.00    0.00    0.00    0.00      10 
outer_join_not_found                   1.00    0.00    0.00    0.00     500 
outer_join_on_key                      2.00    0.00    0.00    0.00      10 
prepared_select                       40.00   15.15    2.50   17.65  100000 
select_1_row                          18.00    4.00    2.32    6.32  100000 
select_1_row_cache                     7.00    3.46    1.92    5.38  100000 
select_2_rows                         20.00    4.28    2.33    6.61  100000 
select_big                            13.00   10.52    0.00   10.52      80 
select_big_str                         7.00    2.86    0.90    3.76   10000 
select_cache                           2.00    1.17    0.18    1.35   10000 
select_cache2                         55.00    1.72    0.35    2.07   10000 
select_column+column                  20.00    3.81    2.48    6.29  100000 
select_diff_key                        0.00    0.10    0.00    0.10     500 
select_distinct                        1.00    0.85    0.01    0.86     800 
select_group                           1.00    0.69    0.05    0.74    2911 
select_group_when_MANY_tables          4.00    0.54    0.27    0.81   10000 
select_join                            1.00    0.24    0.01    0.25     100 
select_key                            70.00   30.90    5.96   36.86  200000 
select_key2                           77.00   32.08    5.61   37.69  200000 
select_key2_return_key                72.00   30.65    5.46   36.11  200000 
select_key2_return_prim               74.00   30.88    5.94   36.82  200000 
select_key_prefix                     77.00   32.26    5.44   37.70  200000 
select_key_prefix_join                 2.00    2.02    0.00    2.02     100 
select_key_return_key                 67.00   30.33    5.31   35.64  200000 
select_many_fields                     3.00    2.86    0.38    3.24    2000 
select_range                           5.00    4.20    0.05    4.25     410 
select_range_key2                      3.00    2.54    0.32    2.86   25010 
select_range_prefix                    4.00    2.49    0.34    2.83   25010 
select_simple                         10.00    3.20    2.16    5.36  100000 
select_simple_cache                    9.00    3.16    2.17    5.33  100000 
select_simple_join                     0.00    0.31    0.00    0.31     500 
update_big                            20.00    0.00    0.00    0.00      10 
update_of_key                         10.00    2.02    1.24    3.26   50000 
update_of_key_big                     11.00    0.04    0.00    0.04     501 
update_of_primary_key_many_keys       11.00    0.01    0.02    0.03     256 
update_with_key                       48.00   10.49    7.12   17.61  300000 
update_with_key_prefix                18.00    5.04    2.46    7.50  100000 
wisc_benchmark                         1.00    1.30    0.01    1.31     114 
TOTALS                              2750.00  415.91   89.59  505.50 3425950 
VPS

C RamDisk:

[root@vm9449 sql-bench]# perl run-all-tests --password='password'
Benchmark DBD suite: 2.15
Date of test:        2011-11-23  0:48:48
Running tests on:    Linux 2.6.32.41-.domUxen i686
Arguments:
Comments:
Limits from:
Server version:      MySQL 5.5.18
Optimization:        None
Hardware:

alter-table: Total time: 34 wallclock secs ( 0.05 usr  0.03 sys +  0.00 cusr  0.00 csys =  0.08 CPU)
ATIS: Total time: 15 wallclock secs ( 3.44 usr  0.49 sys +  0.00 cusr  0.00 csys =  3.93 CPU)
big-tables: Total time: 13 wallclock secs ( 2.02 usr  0.77 sys +  0.00 cusr  0.00 csys =  2.79 CPU)
connect: Total time: 106 wallclock secs (22.87 usr 18.44 sys +  0.00 cusr  0.00 csys = 41.31 CPU)
create: Warning: Can't execute create.  Check the file 'output/create-mysql-Linux_2.6.32.41_.domUxen_i686
'
Failed (output/create-mysql-Linux_2.6.32.41_.domUxen_i686)
insert: Total time: 1974 wallclock secs (229.88 usr 69.96 sys +  0.00 cusr  0.00 csys = 299.84 CPU)
select: Total time: 313 wallclock secs (20.75 usr  4.58 sys +  0.00 cusr  0.00 csys = 25.33 CPU)
transactions: Test skipped because the database doesn't support transactions
wisconsin: Total time: 10 wallclock secs ( 1.67 usr  0.87 sys +  0.00 cusr  0.00 csys =  2.54 CPU)

Of 9 tests, 1 tests didn't work

Totals per operation:
Operation             seconds     usr     sys     cpu   tests
alter_table_add                       16.00    0.01    0.00    0.01     100
alter_table_drop                      15.00    0.01    0.01    0.02      91
connect                                6.00    2.52    0.95    3.47   10000
connect+select_1_row                   7.00    2.71    1.16    3.87   10000
connect+select_simple                  7.00    2.95    1.05    4.00   10000
count                                 14.00    0.02    0.00    0.02     100
count_distinct                         5.00    0.12    0.02    0.14    1000
count_distinct_2                      11.00    0.15    0.04    0.19    1000
count_distinct_big                    31.00    2.83    0.04    2.87     120
count_distinct_group                  14.00    0.45    0.02    0.47    1000
count_distinct_group_on_key            9.00    0.16    0.05    0.21    1000
count_distinct_group_on_key_parts     13.00    0.43    0.03    0.46    1000
count_distinct_key_prefix              6.00    0.13    0.02    0.15    1000
count_group_on_key_parts               7.00    0.40    0.04    0.44    1000
count_on_key                          82.00    4.65    1.31    5.96   50100
create_index                           2.00    0.00    0.00    0.00       8
create_table                           0.00    0.00    0.00    0.00      31
delete_all_many_keys                 276.00    0.01    0.00    0.01       1
delete_big                             0.00    0.00    0.00    0.00       1
delete_big_many_keys                 275.00    0.01    0.00    0.01     128
delete_key                             2.00    0.22    0.22    0.44   10000
delete_range                           4.00    0.00    0.01    0.01      12
drop_index                             0.00    0.00    0.00    0.00       8
drop_table                             0.00    0.00    0.00    0.00      28
insert                                79.00    7.73    8.02   15.75  350768
insert_duplicates                     16.00    2.83    2.59    5.42  100000
insert_key                           168.00    3.37    2.45    5.82  100000
insert_many_fields                     3.00    0.12    0.05    0.17    2000
insert_select_1_key                    3.00    0.00    0.00    0.00       1
insert_select_2_keys                   3.00    0.01    0.00    0.01       1
min_max                                8.00    0.02    0.00    0.02      60
min_max_on_key                        19.00    7.32    2.69   10.01   85000
multiple_value_insert                  3.00    0.14    0.02    0.16  100000
once_prepared_select                  22.00    4.46    2.74    7.20  100000
order_by_big                          14.00    9.79    0.36   10.15      10
order_by_big_key                      13.00    9.41    0.53    9.94      10
order_by_big_key2                     11.00    9.05    0.32    9.37      10
order_by_big_key_desc                 13.00    9.22    0.58    9.80      10
order_by_big_key_diff                 12.00    9.74    0.34   10.08      10
order_by_big_key_prefix               12.00    8.64    0.36    9.00      10
order_by_key2_diff                     1.00    0.77    0.05    0.82     500
order_by_key_prefix                    1.00    0.43    0.01    0.44     500
order_by_range                         1.00    0.41    0.02    0.43     500
outer_join                            15.00    0.01    0.00    0.01      10
outer_join_found                      13.00    0.00    0.00    0.00      10
outer_join_not_found                  11.00    0.00    0.00    0.00     500
outer_join_on_key                      9.00    0.00    0.00    0.00      10
prepared_select                       29.00    9.85    2.85   12.70  100000
select_1_row                          15.00    2.48    2.37    4.85  100000
select_1_row_cache                    15.00    2.36    2.31    4.67  100000
select_2_rows                         17.00    2.57    2.68    5.25  100000
select_big                            13.00   10.47    0.41   10.88      80
select_big_str                         4.00    1.46    0.54    2.00   10000
select_cache                          62.00    1.08    0.25    1.33   10000
select_cache2                         61.00    1.05    0.27    1.32   10000
select_column+column                  15.00    2.19    2.59    4.78  100000
select_diff_key                        0.00    0.05    0.01    0.06     500
select_distinct                        6.00    0.71    0.02    0.73     800
select_group                          15.00    0.49    0.12    0.61    2911
select_join                            0.00    0.20    0.00    0.20     100
select_key                            52.00   19.52    6.51   26.03  200000
select_key2                           54.00   18.93    5.93   24.86  200000
select_key2_return_key                51.00   17.95    5.79   23.74  200000
select_key2_return_prim               54.00   19.22    5.93   25.15  200000
select_key_prefix                     54.00   19.47    5.85   25.32  200000
select_key_prefix_join                 3.00    1.59    0.07    1.66     100
select_key_return_key                 51.00   18.93    6.64   25.57  200000
select_many_fields                    10.00    1.90    0.72    2.62    2000
select_range                          28.00    3.19    0.11    3.30     410
select_range_key2                      8.00    2.09    0.45    2.54   25010
select_range_prefix                    6.00    2.00    0.42    2.42   25010
select_simple                         10.00    1.85    2.40    4.25  100000
select_simple_cache                   10.00    1.77    2.39    4.16  100000
select_simple_join                     1.00    0.19    0.04    0.23     500
update_big                            27.00    0.00    0.00    0.00      10
update_of_key                         15.00    1.06    1.20    2.26   50000
update_of_key_big                     23.00    0.01    0.02    0.03     501
update_of_primary_key_many_keys      652.00    0.01    0.01    0.02     256
update_with_key                       83.00    6.35    7.21   13.56  300000
update_with_key_prefix                27.00    3.45    2.58    6.03  100000
wisc_benchmark                         2.00    1.00    0.16    1.16     114
TOTALS                              2725.00  276.69   94.95  371.64 3375950

С HDD:

[root@vm9449 sql-bench]# perl run-all-tests --password='password'
Benchmark DBD suite: 2.15
Date of test:        2011-11-22 23:00:59
Running tests on:    Linux 2.6.32.41 VDS.domUxen i686
Arguments:
Comments:
Limits from:
Server version:      MySQL 5.5.18
Optimization:        None
Hardware:

alter-table: Total time: 36 wallclock secs ( 0.04 usr  0.05 sys +  0.00 cusr  0.00 csys =  0.09 CPU)
ATIS: Total time: 17 wallclock secs ( 3.83 usr  0.40 sys +  0.00 cusr  0.00 csys =  4.23 CPU)
big-tables: Total time: 14 wallclock secs ( 2.24 usr  0.54 sys +  0.00 cusr  0.00 csys =  2.78 CPU)
connect: Total time: 109 wallclock secs (23.01 usr 19.11 sys +  0.00 cusr  0.00 csys = 42.12 CPU)
create: Total time: 115 wallclock secs ( 3.25 usr  1.76 sys +  0.00 cusr  0.00 csys =  5.01 CPU)
insert: Total time: 2133 wallclock secs (239.71 usr 71.69 sys +  0.00 cusr  0.00 csys = 311.40 CPU)
select: Total time: 341 wallclock secs (23.24 usr  4.97 sys +  0.00 cusr  0.00 csys = 28.21 CPU)
transactions: Test skipped because the database doesn't support transactions
wisconsin: Total time: 13 wallclock secs ( 1.72 usr  1.02 sys +  0.00 cusr  0.00 csys =  2.74 CPU)

All 9 test executed successfully

Totals per operation:
Operation             seconds     usr     sys     cpu   tests
alter_table_add                       18.00    0.01    0.01    0.02     100
alter_table_drop                      15.00    0.01    0.00    0.01      91
connect                                6.00    2.58    0.84    3.42   10000
connect+select_1_row                   8.00    2.78    1.18    3.96   10000
connect+select_simple                  7.00    2.78    1.15    3.93   10000
count                                 14.00    0.02    0.00    0.02     100
count_distinct                         5.00    0.13    0.03    0.16    1000
count_distinct_2                      12.00    0.18    0.01    0.19    1000
count_distinct_big                    39.00    3.17    0.08    3.25     120
count_distinct_group                  16.00    0.50    0.03    0.53    1000
count_distinct_group_on_key            9.00    0.13    0.06    0.19    1000
count_distinct_group_on_key_parts     14.00    0.47    0.04    0.51    1000
count_distinct_key_prefix              6.00    0.15    0.04    0.19    1000
count_group_on_key_parts               8.00    0.39    0.05    0.44    1000
count_on_key                          90.00    5.13    1.44    6.57   50100
create+drop                           27.00    0.91    0.52    1.43   10000
create_MANY_tables                    17.00    0.62    0.26    0.88   10000
create_index                           1.00    0.00    0.00    0.00       8
create_key+drop                       58.00    1.17    0.51    1.68   10000
create_table                           0.00    0.00    0.00    0.00      31
delete_all_many_keys                 286.00    0.01    0.00    0.01       1
delete_big                             0.00    0.00    0.00    0.00       1
delete_big_many_keys                 286.00    0.01    0.00    0.01     128
delete_key                             3.00    0.24    0.22    0.46   10000
delete_range                           3.00    0.00    0.00    0.00      12
drop_index                             1.00    0.00    0.00    0.00       8
drop_table                             0.00    0.00    0.00    0.00      28
drop_table_when_MANY_tables            9.00    0.28    0.25    0.53   10000
insert                               116.00    4.90   12.26   17.16  350768
insert_duplicates                     16.00    3.86    1.35    5.21  100000
insert_key                           172.00    4.02    2.31    6.33  100000
insert_many_fields                     4.00    0.14    0.05    0.19    2000
insert_select_1_key                    3.00    0.00    0.00    0.00       1
insert_select_2_keys                   3.00    0.00    0.00    0.00       1
min_max                                7.00    0.01    0.01    0.02      60
min_max_on_key                        20.00    7.69    2.71   10.40   85000
multiple_value_insert                  3.00    0.16    0.00    0.16  100000
once_prepared_select                  22.00    4.50    2.58    7.08  100000
order_by_big                          18.00   11.28    0.30   11.58      10
order_by_big_key                      13.00    9.98    0.00    9.98      10
order_by_big_key2                     13.00    9.55    0.33    9.88      10
order_by_big_key_desc                 14.00   10.24    0.13   10.37      10
order_by_big_key_diff                 12.00    9.95    0.33   10.28      10
order_by_big_key_prefix               12.00    9.39    0.16    9.55      10
order_by_key2_diff                     1.00    0.83    0.01    0.84     500
order_by_key_prefix                    1.00    0.44    0.02    0.46     500
order_by_range                         0.00    0.47    0.03    0.50     500
outer_join                            14.00    0.00    0.00    0.00      10
outer_join_found                      15.00    0.00    0.00    0.00      10
outer_join_not_found                  12.00    0.00    0.01    0.01     500
outer_join_on_key                     10.00    0.00    0.01    0.01      10
prepared_select                       27.00   10.94    0.97   11.91  100000
select_1_row                          17.00    2.55    2.74    5.29  100000
select_1_row_cache                    15.00    2.16    2.70    4.86  100000
select_2_rows                         16.00    2.49    2.55    5.04  100000
select_big                            12.00   10.00    0.01   10.01      80
select_big_str                         4.00    1.33    0.68    2.01   10000
select_cache                          64.00    1.16    0.30    1.46   10000
select_cache2                         67.00    1.27    0.29    1.56   10000
select_column+column                  17.00    2.42    2.77    5.19  100000
select_diff_key                        0.00    0.05    0.02    0.07     500
select_distinct                        5.00    0.69    0.00    0.69     800
select_group                          16.00    0.53    0.09    0.62    2911
select_group_when_MANY_tables          4.00    0.27    0.22    0.49   10000
select_join                            0.00    0.20    0.00    0.20     100
select_key                            53.00   19.85    6.88   26.73  200000
select_key2                           57.00   19.87    6.17   26.04  200000
select_key2_return_key                54.00   19.21    5.96   25.17  200000
select_key2_return_prim               56.00   20.43    5.94   26.37  200000
select_key_prefix                     58.00   20.45    6.25   26.70  200000
select_key_prefix_join                 4.00    1.81    0.00    1.81     100
select_key_return_key                 51.00   19.18    6.92   26.10  200000
select_many_fields                    10.00    2.10    0.49    2.59    2000
select_range                          31.00    3.80    0.12    3.92     410
select_range_key2                      6.00    2.01    0.53    2.54   25010
select_range_prefix                    8.00    2.02    0.49    2.51   25010
select_simple                         10.00    1.97    2.24    4.21  100000
select_simple_cache                    9.00    1.95    2.26    4.21  100000
select_simple_join                     1.00    0.28    0.02    0.30     500
update_big                            24.00    0.00    0.00    0.00      10
update_of_key                         21.00    1.65    0.84    2.49   50000
update_of_key_big                     30.00    0.04    0.01    0.05     501
update_of_primary_key_many_keys      689.00    0.02    0.01    0.03     256
update_with_key                      112.00    9.14    5.57   14.71  300000
update_with_key_prefix                40.00    0.76    5.97    6.73  100000
wisc_benchmark                         2.00    1.23    0.00    1.23     114
TOTALS                              3049.00  292.91   99.33  392.24 3425950
ССылки
You could leave a comment if you were logged in.
ramdisk.txt · Last modified: 2011/11/23 19:51 (external edit)

Page Tools