Skip to content
Snippets Groups Projects
Commit cf9ba4a7 authored by Florian Fischer's avatar Florian Fischer
Browse files

fix memory footprint of mysql

parent 28edd13a
No related branches found
No related tags found
No related merge requests found
# 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
``` ```
......
...@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment