Skip to content

Latest commit

 

History

History
52 lines (36 loc) · 1.56 KB

File metadata and controls

52 lines (36 loc) · 1.56 KB

Memory Microbenchmark

Memory allocation and access pattern microbenchmarks for performance evaluation.

What it does

Memory microbenchmarks test memory subsystem performance through:

  • Memory allocation: Dynamic memory allocation/deallocation patterns
  • Memory access: Different access patterns (sequential, random)
  • Memory pressure: Multi-container memory contention scenarios

How to run

Build the container

docker build -t mem_micro .

Individual container execution

# Run memory benchmark directly
docker run -itd --name="worker" --runtime=runc --cpuset-cpus=0 --memory=512m mem_micro

# Execute memory test inside container
docker exec -itd worker /usr/local/bin/memory.sh --log 21 13 3 2 300

# Copy results  
docker exec worker cat /app/mem_out.log > memory_results.log

Memory test parameters

The memory binary accepts these parameters:

  • ./memory <total> <mmap_size> <option> <touch_option> <duration>

Common configurations:

  • 21 13 3 2 - Allocate/unmap 1GB in 8KB chunks, touch each page
  • 20 14 3 2 - Allocate/unmap 1GB in 16KB chunks, touch each page

Parameter meanings:

  • total: Total memory size (power of 2, e.g., 21 = 2^21 = 2MB)
  • mmap_size: Chunk size (power of 2, e.g., 13 = 2^13 = 8KB)
  • option: 1=alloc only, 2=alloc+unmap, 3=alloc+unmap+touch
  • touch_option: 0=no touch, 1=touch first page, 2=touch all pages
  • duration: Test duration in seconds

Available scripts

  • memory.sh - Wrapper script for memory binary with logging
  • setup.sh - Setup and build memory binary