MySQL SlapをNDB対して実行して、メモリー割り当て変化の簡単な確認

[root@misc bin]# /usr/local/mysql/bin/mysqlslap --no-defaults --create-schema=SLAP --engine=ndb --auto-generate-sql --auto-generate-sql-add-autoincrement --engine=ndb --number-int-cols=3 --number-char-cols=5 --concurrency=10 --auto-generate-sql-write-number=10000 --auto-generate-sql-execute-number=10000 --auto-generate-sql-load-type=mixed -h 192.168.56.114 -u admin -p
Enter password: 
Benchmark
        Running for engine ndb
        Average number of seconds to run all queries: 135.323 seconds
        Minimum number of seconds to run all queries: 135.323 seconds
        Maximum number of seconds to run all queries: 135.323 seconds
        Number of clients running queries: 10
        Average number of queries per client: 10000

[root@misc bin]# 

ndb

Node, alloc_bytes,free_bytesを確認する限りだと、ノード間のデータは同期されているので均等に分かれている。
こちらに、追加でノードグループを増やしたときのテーブル分割を次回確認してみる。

mysql> select * from memoryusage;
+---------+---------------------+---------+------------+-----------+-------------+
| node_id | memory_type         | used    | used_pages | total     | total_pages |
+---------+---------------------+---------+------------+-----------+-------------+
|       1 | Data memory         | 2129920 |         65 | 134217728 |        4096 |
|       1 | Index memory        |  475136 |         58 |  67371008 |        8224 |
|       1 | Long message buffer |    2304 |          9 |  67108864 |      262144 |
|       2 | Data memory         | 2129920 |         65 | 134217728 |        4096 |
|       2 | Index memory        |  475136 |         58 |  67371008 |        8224 |
|       2 | Long message buffer |    2304 |          9 |  67108864 |      262144 |
+---------+---------------------+---------+------------+-----------+-------------+
6 rows in set (0.02 sec)

mysql> select * from resources;
+---------+---------------------+----------+------+-------+
| node_id | resource_name       | reserved | used | max   |
+---------+---------------------+----------+------+-------+
|       1 | RESERVED            |     4113 | 5495 | 13703 |
|       1 | DISK_OPERATIONS     |        0 |    0 |     0 |
|       1 | DISK_RECORDS        |        0 |    0 |     0 |
|       1 | DATA_MEMORY         |     6152 | 2158 |  6152 |
|       1 | JOBBUFFER           |        0 |    0 |     0 |
|       1 | FILE_BUFFERS        |     1152 | 1096 |  1152 |
|       1 | TRANSPORTER_BUFFERS |        0 |    0 |     0 |
|       1 | DISK_PAGE_BUFFER    |     2240 | 2240 |  2240 |
|       1 | QUERY_MEMORY        |        0 |    0 |     0 |
|       1 | SCHEMA_TRANS_MEMORY |       64 |    1 |     0 |
|       2 | RESERVED            |     4113 | 5495 | 13703 |
|       2 | DISK_OPERATIONS     |        0 |    0 |     0 |
|       2 | DISK_RECORDS        |        0 |    0 |     0 |
|       2 | DATA_MEMORY         |     6152 | 2158 |  6152 |
|       2 | JOBBUFFER           |        0 |    0 |     0 |
|       2 | FILE_BUFFERS        |     1152 | 1096 |  1152 |
|       2 | TRANSPORTER_BUFFERS |        0 |    0 |     0 |
|       2 | DISK_PAGE_BUFFER    |     2240 | 2240 |  2240 |
|       2 | QUERY_MEMORY        |        0 |    0 |     0 |
|       2 | SCHEMA_TRANS_MEMORY |       64 |    1 |     0 |
+---------+---------------------+----------+------+-------+
20 rows in set (0.01 sec)

mysql> select * from memoryusage;
+---------+---------------------+---------+------------+-----------+-------------+
| node_id | memory_type         | used    | used_pages | total     | total_pages |
+---------+---------------------+---------+------------+-----------+-------------+
|       1 | Data memory         | 3735552 |        114 | 134217728 |        4096 |
|       1 | Index memory        |  524288 |         64 |  67371008 |        8224 |
|       1 | Long message buffer |    2304 |          9 |  67108864 |      262144 |
|       2 | Data memory         | 3735552 |        114 | 134217728 |        4096 |
|       2 | Index memory        |  524288 |         64 |  67371008 |        8224 |
|       2 | Long message buffer |    2304 |          9 |  67108864 |      262144 |
+---------+---------------------+---------+------------+-----------+-------------+
6 rows in set (0.00 sec)

mysql> select node_id AS node, fragment_num AS frag,
    -> fixed_elem_alloc_bytes alloc_bytes,
    -> fixed_elem_free_bytes AS free_bytes
    -> from ndbinfo.memory_per_fragment where fq_name like '%t1%';
+------+------+-------------+------------+
| node | frag | alloc_bytes | free_bytes |
+------+------+-------------+------------+
|    1 |    0 |       98304 |       6624 |
|    1 |    1 |       98304 |       4080 |
|    2 |    0 |       98304 |       6624 |
|    2 |    1 |       98304 |       4032 |
+------+------+-------------+------------+
4 rows in set (0.01 sec)

mysql> select node_id AS node, fragment_num AS frag,
    -> fixed_elem_alloc_bytes alloc_bytes,
    -> fixed_elem_free_bytes AS free_bytes
    -> from ndbinfo.memory_per_fragment where fq_name like '%t1%';
+------+------+-------------+------------+
| node | frag | alloc_bytes | free_bytes |
+------+------+-------------+------------+
|    1 |    0 |      524288 |      26928 |
|    1 |    1 |      524288 |      27984 |
|    2 |    0 |      524288 |      26880 |
|    2 |    1 |      524288 |      27984 |
+------+------+-------------+------------+
4 rows in set (0.02 sec)

mysql> select node_id AS node, fragment_num AS frag,
    -> fixed_elem_alloc_bytes alloc_bytes,
    -> fixed_elem_free_bytes AS free_bytes
    -> from ndbinfo.memory_per_fragment where fq_name like '%t1%';
+------+------+-------------+------------+
| node | frag | alloc_bytes | free_bytes |
+------+------+-------------+------------+
|    1 |    0 |      819200 |      27888 |
|    1 |    1 |      819200 |      30720 |
|    2 |    0 |      819200 |      27888 |
|    2 |    1 |      819200 |      30672 |
+------+------+-------------+------------+
4 rows in set (0.02 sec)

mysql> select node_id AS node, fragment_num AS frag,
    -> fixed_elem_alloc_bytes alloc_bytes,
    -> fixed_elem_free_bytes AS free_bytes
    -> from ndbinfo.memory_per_fragment where fq_name like '%t1%';
+------+------+-------------+------------+
| node | frag | alloc_bytes | free_bytes |
+------+------+-------------+------------+
|    1 |    0 |     1212416 |      22272 |
|    1 |    1 |     1212416 |      16080 |
|    2 |    0 |     1212416 |      22272 |
|    2 |    1 |     1212416 |      16032 |
+------+------+-------------+------------+
4 rows in set (0.02 sec)

mysql> select node_id AS node, fragment_num AS frag,
    -> fixed_elem_alloc_bytes alloc_bytes,
    -> fixed_elem_free_bytes AS free_bytes
    -> from ndbinfo.memory_per_fragment where fq_name like '%t1%';
Empty set (0.02 sec)

mysql> 

Comments are closed.

Post Navigation