MySQL Cluster Configuration Files
1561
A value greater than
100
is interpreted as a number of bytes.
In MySQL 5.0, the default value is
100
—that is, 100 percent of the default maximum, or roughly
5 MB. It is possible to reduce this value safely, but it should never be less than 5 percent. If you
encounter Error 773
Out of string memory, please modify StringMemory config
parameter: Permanent error: Schema error
, this means that means that you have set the
StringMemory
value too low.
25
(25 percent) is not excessive, and should prevent this error from
recurring in all but the most extreme conditions, as when there are hundreds or thousands of
NDB
tables with names whose lengths and columns whose number approach their permitted maximums.
The following example illustrates how memory is used for a table. Consider this table definition:
CREATE TABLE example (
a INT NOT NULL,
b INT NOT NULL,
c INT NOT NULL,
PRIMARY KEY(a),
UNIQUE(b)
) ENGINE=NDBCLUSTER;
For each record, there are 12 bytes of data plus 12 bytes overhead. Having no nullable columns saves
4 bytes of overhead. In addition, we have two ordered indexes on columns
a
and
b
consuming roughly
10 bytes each per record. There is a primary key hash index on the base table using roughly 29 bytes
per record. The unique constraint is implemented by a separate table with
b
as primary key and
a
as a
column. This other table consumes an additional 29 bytes of index memory per record in the
example
table as well 8 bytes of record data plus 12 bytes of overhead.
Thus, for one million records, we need 58MB for index memory to handle the hash indexes for the
primary key and the unique constraint. We also need 64MB for the records of the base table and the
unique index table, plus the two ordered index tables.
You can see that hash indexes takes up a fair amount of memory space; however, they provide
very fast access to the data in return. They are also used in MySQL Cluster to handle uniqueness
constraints.
Currently, the only partitioning algorithm is hashing and ordered indexes are local to each node. Thus,
ordered indexes cannot be used to handle uniqueness constraints in the general case.
An important point for both
IndexMemory
and
DataMemory
is that the total database size is the
sum of all data memory and all index memory for each node group. Each node group is used to store
replicated information, so if there are four nodes with two replicas, there will be two node groups. Thus,
the total data memory available is 2 ×
DataMemory
for each data node.
It is highly recommended that
DataMemory
and
IndexMemory
be set to the same values for all
nodes. Data distribution is even over all nodes in the cluster, so the maximum amount of space
available for any node can be no greater than that of the smallest node in the cluster.
DataMemory
and
IndexMemory
can be changed, but decreasing either of these can be risky; doing
so can easily lead to a node or even an entire MySQL Cluster that is unable to restart due to there
being insufficient memory space. Increasing these values should be acceptable, but it is recommended
that such upgrades are performed in the same manner as a software upgrade, beginning with an
update of the configuration file, and then restarting the management server followed by restarting each
data node in turn.
Updates do not increase the amount of index memory used. Inserts take effect immediately; however,
rows are not actually deleted until the transaction is committed.
Transaction parameters.
The next three
[ndbd]
parameters that we discuss are important
because they affect the number of parallel transactions and the sizes of transactions that can be
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...