Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
allocbench
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Fischer
allocbench
Commits
cf9ba4a7
Commit
cf9ba4a7
authored
Jul 23, 2018
by
Florian Fischer
Browse files
Options
Downloads
Patches
Plain Diff
fix memory footprint of mysql
parent
28edd13a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Readme.md
+2
-1
2 additions, 1 deletion
Readme.md
mysql.py
+4
-5
4 additions, 5 deletions
mysql.py
with
6 additions
and
6 deletions
Readme.md
+
2
−
1
View file @
cf9ba4a7
# allocbench - benchmark tool for memory allocators
# allocbench - benchmark tool for memory allocators
to download allocbench just run
to download allocbench just run
```
shell
```
shell
git clone https://muhq.space/software/allocbench.git
git clone https://muhq.space/software/allocbench.git
```
```
...
...
This diff is collapsed.
Click to expand it.
mysql.py
+
4
−
5
View file @
cf9ba4a7
...
@@ -34,7 +34,8 @@ class Benchmark_MYSQL( Benchmark ):
...
@@ -34,7 +34,8 @@ class Benchmark_MYSQL( Benchmark ):
self
.
nthreads
=
range
(
1
,
multiprocessing
.
cpu_count
()
*
2
+
1
)
self
.
nthreads
=
range
(
1
,
multiprocessing
.
cpu_count
()
*
2
+
1
)
self
.
results
=
{
"
args
"
:
{
"
nthreads
"
:
self
.
nthreads
},
self
.
results
=
{
"
args
"
:
{
"
nthreads
"
:
self
.
nthreads
},
"
targets
"
:
self
.
targets
}
"
targets
"
:
self
.
targets
,
"
memusage
"
:
{
t
:
[]
for
t
in
self
.
targets
}}
def
start_and_wait_for_server
(
self
,
verbose
,
log
=
None
):
def
start_and_wait_for_server
(
self
,
verbose
,
log
=
None
):
if
not
log
:
if
not
log
:
...
@@ -122,9 +123,7 @@ class Benchmark_MYSQL( Benchmark ):
...
@@ -122,9 +123,7 @@ class Benchmark_MYSQL( Benchmark ):
# Get initial memory footprint
# Get initial memory footprint
ps
=
subprocess
.
run
([
"
ps
"
,
"
-F
"
,
str
(
self
.
server
.
pid
)],
stdout
=
subprocess
.
PIPE
)
ps
=
subprocess
.
run
([
"
ps
"
,
"
-F
"
,
str
(
self
.
server
.
pid
)],
stdout
=
subprocess
.
PIPE
)
tokens
=
str
(
ps
.
stdout
.
splitlines
()[
1
]).
split
()
tokens
=
str
(
ps
.
stdout
.
splitlines
()[
1
]).
split
()
if
not
tname
in
self
.
results
[
"
memusage
"
]:
self
.
results
[
"
memusage
"
][
tname
].
append
({
"
VSZ_start
"
:
tokens
[
4
],
"
RSS_start
"
:
tokens
[
5
]})
self
.
results
[
"
memusage
"
]
=
[]
self
.
results
[
"
memusage
"
].
append
({
"
VSZ_start
"
:
tokens
[
4
],
"
RSS_start
"
:
tokens
[
5
]})
for
i
,
thread
in
enumerate
(
self
.
nthreads
):
for
i
,
thread
in
enumerate
(
self
.
nthreads
):
print
(
tname
+
"
:
"
,
i
+
1
,
"
of
"
,
n
,
"
\r
"
,
end
=
''
)
print
(
tname
+
"
:
"
,
i
+
1
,
"
of
"
,
n
,
"
\r
"
,
end
=
''
)
...
@@ -161,7 +160,7 @@ class Benchmark_MYSQL( Benchmark ):
...
@@ -161,7 +160,7 @@ class Benchmark_MYSQL( Benchmark ):
# Get final memory footprint
# Get final memory footprint
ps
=
subprocess
.
run
([
"
ps
"
,
"
-F
"
,
str
(
self
.
server
.
pid
)],
stdout
=
subprocess
.
PIPE
)
ps
=
subprocess
.
run
([
"
ps
"
,
"
-F
"
,
str
(
self
.
server
.
pid
)],
stdout
=
subprocess
.
PIPE
)
tokens
=
str
(
ps
.
stdout
.
splitlines
()[
1
]).
split
()
tokens
=
str
(
ps
.
stdout
.
splitlines
()[
1
]).
split
()
self
.
results
[
"
memusage
"
][
tname
][
run
].
update
({
"
VSZ_end
"
:
tokens
[
4
],
"
RSS_end
"
:
tokens
[
5
]})
self
.
results
[
"
memusage
"
][
tname
][
run
-
1
].
update
({
"
VSZ_end
"
:
tokens
[
4
],
"
RSS_end
"
:
tokens
[
5
]})
self
.
server
.
kill
()
self
.
server
.
kill
()
self
.
server
.
wait
()
self
.
server
.
wait
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment