Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4456144c
Commit
4456144c
authored
Dec 06, 2006
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - add support for periodic mem-reporting
parent
b7deb4dc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
11 deletions
+57
-11
storage/ndb/include/mgmapi/mgmapi_config_parameters.h
storage/ndb/include/mgmapi/mgmapi_config_parameters.h
+2
-0
storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp
storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp
+1
-0
storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
+21
-7
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
+1
-0
storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
+20
-4
storage/ndb/src/mgmsrv/ConfigInfo.cpp
storage/ndb/src/mgmsrv/ConfigInfo.cpp
+12
-0
No files found.
storage/ndb/include/mgmapi/mgmapi_config_parameters.h
View file @
4456144c
...
...
@@ -96,6 +96,8 @@
#define CFG_DB_CHECKPOINT_SPEED 164
#define CFG_DB_CHECKPOINT_SPEED_SR 165
#define CFG_DB_MEMREPORT_FREQUENCY 166
#define CFG_DB_SGA 198
/* super pool mem */
#define CFG_DB_DATA_MEM_2 199
/* used in special build in 5.1 */
...
...
storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp
View file @
4456144c
...
...
@@ -1100,6 +1100,7 @@ private:
};
Uint32
c_errorInsert3000_TableId
;
Uint32
c_memusage_report_frequency
;
};
#endif
storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
View file @
4456144c
...
...
@@ -112,6 +112,7 @@ void Dbacc::execCONTINUEB(Signal* signal)
}
case
ZREPORT_MEMORY_USAGE
:{
jam
();
Uint32
cnt
=
signal
->
theData
[
1
];
static
int
c_currentMemUsed
=
0
;
int
now
=
cpagesize
?
(
cnoOfAllocatedPages
*
100
)
/
cpagesize
:
0
;
const
int
thresholds
[]
=
{
99
,
90
,
80
,
0
};
...
...
@@ -125,14 +126,22 @@ void Dbacc::execCONTINUEB(Signal* signal)
}
}
if
(
now
!=
c_currentMemUsed
){
reportMemoryUsage
(
signal
,
now
>
c_currentMemUsed
?
1
:
-
1
);
if
(
now
!=
c_currentMemUsed
||
(
c_memusage_report_frequency
&&
cnt
+
1
==
c_memusage_report_frequency
))
{
reportMemoryUsage
(
signal
,
now
>
c_currentMemUsed
?
1
:
now
<
c_currentMemUsed
?
-
1
:
0
);
cnt
=
0
;
c_currentMemUsed
=
now
;
}
else
{
cnt
++
;
}
c_currentMemUsed
=
now
;
signal
->
theData
[
0
]
=
ZREPORT_MEMORY_USAGE
;
sendSignalWithDelay
(
reference
(),
GSN_CONTINUEB
,
signal
,
2000
,
1
);
signal
->
theData
[
1
]
=
cnt
;
sendSignalWithDelay
(
reference
(),
GSN_CONTINUEB
,
signal
,
1000
,
2
);
return
;
}
...
...
@@ -199,7 +208,8 @@ void Dbacc::execNDB_STTOR(Signal* signal)
csystemRestart
=
ZFALSE
;
signal
->
theData
[
0
]
=
ZREPORT_MEMORY_USAGE
;
sendSignalWithDelay
(
reference
(),
GSN_CONTINUEB
,
signal
,
2000
,
1
);
signal
->
theData
[
1
]
=
0
;
sendSignalWithDelay
(
reference
(),
GSN_CONTINUEB
,
signal
,
1000
,
2
);
break
;
default:
jam
();
...
...
@@ -353,6 +363,10 @@ void Dbacc::execREAD_CONFIG_REQ(Signal* signal)
initRecords
();
ndbrestart1Lab
(
signal
);
c_memusage_report_frequency
=
0
;
ndb_mgm_get_int_parameter
(
p
,
CFG_DB_MEMREPORT_FREQUENCY
,
&
c_memusage_report_frequency
);
tdata0
=
0
;
initialiseRecordsLab
(
signal
,
ref
,
senderData
);
return
;
...
...
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
View file @
4456144c
...
...
@@ -2571,6 +2571,7 @@ private:
// Trigger variables
Uint32
c_maxTriggersPerTable
;
Uint32
c_memusage_report_frequency
;
Uint32
c_errorInsert4000TableId
;
Uint32
c_min_list_size
[
MAX_FREE_LIST
+
1
];
...
...
storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
View file @
4456144c
...
...
@@ -169,6 +169,7 @@ void Dbtup::execCONTINUEB(Signal* signal)
case
ZREPORT_MEMORY_USAGE
:{
ljam
();
static
int
c_currentMemUsed
=
0
;
Uint32
cnt
=
signal
->
theData
[
1
];
Uint32
tmp
=
c_page_pool
.
getSize
();
int
now
=
tmp
?
(
cnoOfAllocatedPages
*
100
)
/
tmp
:
0
;
const
int
thresholds
[]
=
{
100
,
90
,
80
,
0
};
...
...
@@ -182,12 +183,22 @@ void Dbtup::execCONTINUEB(Signal* signal)
}
}
if
(
now
!=
c_currentMemUsed
){
reportMemoryUsage
(
signal
,
now
>
c_currentMemUsed
?
1
:
-
1
);
if
(
now
!=
c_currentMemUsed
||
(
c_memusage_report_frequency
&&
cnt
+
1
==
c_memusage_report_frequency
))
{
reportMemoryUsage
(
signal
,
now
>
c_currentMemUsed
?
1
:
now
<
c_currentMemUsed
?
-
1
:
0
);
cnt
=
0
;
c_currentMemUsed
=
now
;
}
else
{
cnt
++
;
}
signal
->
theData
[
0
]
=
ZREPORT_MEMORY_USAGE
;
sendSignalWithDelay
(
reference
(),
GSN_CONTINUEB
,
signal
,
2000
,
1
);
signal
->
theData
[
1
]
=
cnt
;
sendSignalWithDelay
(
reference
(),
GSN_CONTINUEB
,
signal
,
1000
,
2
);
return
;
}
case
ZBUILD_INDEX
:
...
...
@@ -337,6 +348,10 @@ void Dbtup::execREAD_CONFIG_REQ(Signal* signal)
clastBitMask
=
1
;
clastBitMask
=
clastBitMask
<<
31
;
c_memusage_report_frequency
=
0
;
ndb_mgm_get_int_parameter
(
p
,
CFG_DB_MEMREPORT_FREQUENCY
,
&
c_memusage_report_frequency
);
initialiseRecordsLab
(
signal
,
0
,
ref
,
senderData
);
}
//Dbtup::execSIZEALT_REP()
...
...
@@ -499,7 +514,8 @@ void Dbtup::execNDB_STTOR(Signal* signal)
/* RESTART. */
/*****************************************/
signal
->
theData
[
0
]
=
ZREPORT_MEMORY_USAGE
;
sendSignalWithDelay
(
reference
(),
GSN_CONTINUEB
,
signal
,
2000
,
1
);
signal
->
theData
[
1
]
=
0
;
sendSignalWithDelay
(
reference
(),
GSN_CONTINUEB
,
signal
,
1000
,
1
);
break
;
default:
ljam
();
...
...
storage/ndb/src/mgmsrv/ConfigInfo.cpp
View file @
4456144c
...
...
@@ -1298,6 +1298,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"0"
,
"0"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
{
CFG_DB_MEMREPORT_FREQUENCY
,
"MemReportFrequency"
,
DB_TOKEN
,
"Frequency of mem reports in seconds, 0 = only when passing %-limits"
,
ConfigInfo
::
CI_USED
,
false
,
ConfigInfo
::
CI_INT
,
"0"
,
"0"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
/***************************************************************************
* API
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment