MySQL Cluster Configuration Files
1559
understand how
DataMemory
and
IndexMemory
are used, as they usually need to be updated to
reflect actual usage by the cluster:
•
DataMemory
Effective Version
Type/Units
Default
Range/Values
MySQL 5.0.0
bytes
80M
1M - 1024G
Restart Type: N
This parameter defines the amount of space (in bytes) available for storing database records. The
entire amount specified by this value is allocated in memory, so it is extremely important that the
machine has sufficient physical memory to accommodate it.
The memory allocated by
DataMemory
is used to store both the actual records and indexes. Each
record is currently of fixed size. (Even
VARCHAR
columns are stored as fixed-width columns.) There
is a 16-byte overhead on each record; an additional amount for each record is incurred because it
is stored in a 32KB page with 128 byte page overhead (see below). There is also a small amount
wasted per page due to the fact that each record is stored in only one page.
The maximum record size is currently 8052 bytes.
The memory space defined by
DataMemory
is also used to store ordered indexes, which use about
10 bytes per record. Each table row is represented in the ordered index. A common error among
users is to assume that all indexes are stored in the memory allocated by
IndexMemory
, but this
is not the case: Only primary key and unique hash indexes use this memory; ordered indexes use
the memory allocated by
DataMemory
. However, creating a primary key or unique hash index
also creates an ordered index on the same keys, unless you specify
USING HASH
in the index
creation statement. This can be verified by running
ndb_desc -d db_name table_name
in the
management client.
Currently, MySQL Cluster can use a maximum of 512 MB for hash indexes per partition, which
means in some cases it is possible to get
Table is full
errors in MySQL client applications even
when
ndb_mgm -e "ALL REPORT MEMORYUSAGE"
shows significant free
DataMemory
[1559]
.
This can also pose a problem with data node restarts on nodes that are heavily loaded with data.
You can force
NDB
to create extra partitions for MySQL Cluster tables and thus have more memory
available for hash indexes by using the
MAX_ROWS
option for
CREATE TABLE
. In general, setting
MAX_ROWS
to twice the number of rows that you expect to store in the table should be sufficient.
The memory space allocated by
DataMemory
consists of 32KB pages, which are allocated to table
fragments. Each table is normally partitioned into the same number of fragments as there are data
nodes in the cluster. Thus, for each node, there are the same number of fragments as are set in
NoOfReplicas
.
In addition, due to the way in which new pages are allocated when the capacity of the current page
is exhausted, there is an additional overhead of approximately 18.75%. When more
DataMemory
is
required, more than one new page is allocated, according to the following formula:
number of new pages = FLOOR(number of current pages × 0.1875) + 1
For example, if 15 pages are currently allocated to a given table and an insert to this table requires
additional storage space, the number of new pages allocated to the table is
FLOOR(15 × 0.1875)
+ 1 = FLOOR(2.8125) + 1 = 2 + 1 = 3
. Now 15 + 3 = 18 memory pages are allocated
to the table. When the last of these 18 pages becomes full,
FLOOR(18 × 0.1875) + 1 =
FLOOR(3.3750) + 1 = 3 + 1 = 4
new pages are allocated, so the total number of pages
allocated to the table is now 22.
Once a page has been allocated, it is currently not possible to return it to the pool of free pages,
except by deleting the table. (This also means that
DataMemory
pages, once allocated to a given
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...