Linux test ram speed

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Simple RAM benchmark for Linux.

License

rsusik/rambenchmark

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

RAM Benchmark

Simple RAM benchmark for Linux.

This is a simple RAM benchmark written in C++. It allows checking approximate RAM speed. The code creates a 1 GiB (1024*1024*1024 bytes) buffer, fills it with zeroes, scans the buffer, and measure the time.

Note: This is only experimental code written to check the RAM speed on Linux. There are probably better tools for memory analysis available like memtest86.

  • Unix/Linux OS (can be easily ported to Windows)
  • g++ compiler compatible with OpenMP (for multi-threaded variant)
  • at least 1 GB free RAM (for buffer)

Install and run using pip

To execute the benchmark, you only have to meet the requirements and run the below commands:

pip install rambenchmark rambenchmark

If you prefer to compile and execute the code manually, you can do that by running the following commands:

git clone git@github.com:rsusik/rambenchmark.git cd rambenchmark/rambenchmark g++ -O3 -std=c++11 -fopenmp -o rambench ./rambench.cpp ./rambench

The benchmark uses two functions for tests:

The benchmark produces below example output:

Источник

How to Test Your Linux Server’s Disk and RAM Speed

Anthony Heddings

Anthony Heddings
Writer

Anthony Heddings is the resident cloud engineer for LifeSavvy Media, a technical writer, programmer, and an expert at Amazon’s AWS platform. He’s written hundreds of articles for How-To Geek and CloudSavvy IT that have been read millions of times. Read more.

server rack install

If you’re regularly writing or reading files, your disk speed can affect your server’s performance. We’ll show you how to measure your server’s speed, and how to understand how it stacks up to the competition.

Читайте также:  Linux tar gz запаковать файлы

How Is IO Performance Measured?

There are many different ways to read and write to disks, so no single number exists for “speed” that you can measure. The simplest way to measure performance is to time how long it takes to read large files or perform large file copies. This measures sequential read and write speed, which is a good metric to know, but you’ll rarely see speeds this high in practice, especially in a server environment.

A better metric is random access speed, which measures how fast you can access files stored in random blocks, mimicking real-world usage much more.

List of read versus write speeds.

SSDs usually have fast random access speeds compared to hard drives, which makes them much more suited for general use. Hard drives still have decent sequential read and write speeds, which makes them good for data archival and retrieval.

However, disk performance may not matter much for certain workloads. A lot of applications cache objects in memory (if you’ve got enough RAM), so the next time you want to read that object, it will be read from memory instead (which is faster). For write-heavy workloads though, the disk still must accessed.

Speed is often measured in MB/s, but certain providers may measure in IOPS (Input/Output Operations Per Second). This is simply a bigger number meaning the same thing; you can find what IOPS from MB/s with this formula:

IOPS = (MBps / Block Size) * 1024

However, some providers may not do a great job of telling you which benchmark they use for measuring IOPS, so it’s good to do testing yourself.

Install fio for Random Read/Write Tests

While Linux does have the built in dd command, which can be used to measure sequential write performance, it isn’t indicative of how it will behave under real-world stresses. You’ll want to test your random read and write speed instead. fio is a utility that can handle this. Install it from your distro’s package manager:

fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=random_read_write.fio --bs=4k --iodepth=64 --size=250M --readwrite=randrw --rwmixread=80

This runs random read and write tests using a 250 MB of data, at a ratio of 80% reads to 20% writes. The results will display in terms of IOPS and in MB/s:

The above test was run on an AWS gp2 SSD, a fairly average SSD, which shows fairly average performance. Write performance will always be lower with any type of IO; many SSDs and HDDs have built in cache for the drive controller to use, which makes many reads fairly quick. However, whenever you write, you must make physical changes to the drive, which is slower.

Running the test on a hard drive shows low random mixed IO performance, which is a common problem with hard drives:

fio hard drive test results

Hard drives, though, are typically used for large sequential reads and writes, so a random IO test doesn’t match the use case here. If you want to change the test type, you can pass in a different argument for —readwrite . fio supports a lot of different tests:

  • Sequential Read: seqread
  • Sequential Write: seqwrite
  • Random Read: randread
  • Random Write: randwrite
  • Random Mixed IO: randrw
Читайте также:  Moving folder in linux

Additionally, you can change the block size with the —bs argument. We set it to 4K, which is fairly standard for random tests, but sequential reads and writes may show better or worse performance with larger block sizes. Sizes 16KB to 32KB may be closer to what you’ll encounter under real load.

Testing Memory Performance

fio can’t test RAM speed, so if you want to benchmark your server’s RAM, you must install sysbench from your distro’s package manager:

sudo apt-get install sysbench

This package can benchmark a lot of performance metrics, but we’re only focused on the memory test. The following command allocates 1 MB of RAM, then performs write operations until it has written 10 GB of data, (Don’t worry, you don’t need 10 GB of RAM to do this benchmark.)

sysbench --test=memory --memory-block-size=1M --memory-total-size=10G run

This will display the memory speed in MiB/s, as well as the access latency associated with it.

Results of the testing of memory speed in MiB/s, as well as the access latency associated with it.

This test measures write speed, but you can add —memory-oper=read to measure the read speed, which should be a bit higher most of the time. You can also test with lower block sizes, which puts more stress on the memory.

Realistically though, most RAM will be good enough to run just about anything, and you’ll usually be limited more by the amount of RAM than the actual speed of it.

Profile Photo for Anthony Heddings

Anthony Heddings
Anthony Heddings is the resident cloud engineer for LifeSavvy Media, a technical writer, programmer, and an expert at Amazon’s AWS platform. He’s written hundreds of articles for How-To Geek and CloudSavvy IT that have been read millions of times.
Read Full Bio »

Источник

The Linux Cluster

Linux Cluster Blog is a collection of how-to and tutorials for Linux Cluster and Enterprise Linux

Benchmarking Tools for Memory Bandwidth

What is Bandwidth

Bandwidth, is an artificial benchmark primarily for measuring memory bandwidth on x86 and x86_64 based computers, useful for identifying weaknesses in a computer’s memory subsystem, in the bus architecture, in the cache architecture and in the processor itself.

bandwidth also tests some libc functions and, under GNU/Linux, it attempts to test framebuffer memory access speed if the framebuffer device is available.

Prerequisites:

Compiling NASM

Bandwidth-1.94 requires the latest version of NASM.

% tar -xvf nasm-2.15.05.tar.gz % cd nasm-2.15.05 % ./configure % make % make install

You should have nasm binary. Make sure you update $PATH to reflect the path of the nasm binary

Compiling Bandwidth-1.94

% tar -zxvf bandwidth-1.9.4.tar.gz % cd bandwidth-1.9.4 % make bandwidth64

You should have bandwidth64 binary

Run the Test

% ./bandwidth64 Sequential read (64-bit), size = 256 B, loops = 1132462080, 55292.9 MB/s Sequential read (64-bit), size = 384 B, loops = 765632322, 56075.0 MB/s Sequential read (64-bit), size = 512 B, loops = 573833216, 56028.0 MB/s Sequential read (64-bit), size = 640 B, loops = 457595948, 55857.6 MB/s Sequential read (64-bit), size = 768 B, loops = 382990923, 56092.5 MB/s Sequential read (64-bit), size = 896 B, loops = 326929770, 55865.7 MB/s Sequential read (64-bit), size = 1024 B, loops = 285671424, 55789.1 MB/s Sequential read (64-bit), size = 1280 B, loops = 229320072, 55973.6 MB/s Sequential read (64-bit), size = 2 kB, loops = 143425536, 56016.5 MB/s Sequential read (64-bit), size = 3 kB, loops = 95550030, 55977.6 MB/s Sequential read (64-bit), size = 4 kB, loops = 71729152, 56036.7 MB/s Sequential read (64-bit), size = 6 kB, loops = 47510700, 55667.7 MB/s Sequential read (64-bit), size = 8 kB, loops = 35856384, 56020.1 MB/s Sequential read (64-bit), size = 12 kB, loops = 23738967, 55631.2 MB/s Sequential read (64-bit), size = 16 kB, loops = 17666048, 55199.2 MB/s Sequential read (64-bit), size = 20 kB, loops = 14139216, 55228.2 MB/s Sequential read (64-bit), size = 24 kB, loops = 11771760, 55178.0 MB/s Sequential read (64-bit), size = 28 kB, loops = 10097100, 55212.2 MB/s Sequential read (64-bit), size = 32 kB, loops = 8679424, 54246.3 MB/s Sequential read (64-bit), size = 34 kB, loops = 7160732, 47543.7 MB/s Sequential read (64-bit), size = 36 kB, loops = 6404580, 45029.4 MB/s Sequential read (64-bit), size = 40 kB, loops = 5729724, 44762.0 MB/s Sequential read (64-bit), size = 48 kB, loops = 4782960, 44837.4 MB/s Sequential read (64-bit), size = 64 kB, loops = 3603456, 45042.9 MB/s Sequential read (64-bit), size = 128 kB, loops = 1806848, 45168.2 MB/s Sequential read (64-bit), size = 192 kB, loops = 1204753, 45175.8 MB/s Sequential read (64-bit), size = 256 kB, loops = 897792, 44882.4 MB/s Sequential read (64-bit), size = 320 kB, loops = 711144, 44435.3 MB/s Sequential read (64-bit), size = 384 kB, loops = 590070, 44254.7 MB/s Sequential read (64-bit), size = 512 kB, loops = 440064, 43995.8 MB/s Sequential read (64-bit), size = 768 kB, loops = 285005, 42741.0 MB/s Sequential read (64-bit), size = 1024 kB, loops = 170048, 34006.4 MB/s Sequential read (64-bit), size = 1280 kB, loops = 120615, 30152.0 MB/s Sequential read (64-bit), size = 1536 kB, loops = 91434, 27427.4 MB/s Sequential read (64-bit), size = 1792 kB, loops = 77688, 27180.4 MB/s Sequential read (64-bit), size = 2048 kB, loops = 64320, 25722.9 MB/s Sequential read (64-bit), size = 2304 kB, loops = 56252, 25313.3 MB/s Sequential read (64-bit), size = 2560 kB, loops = 49550, 24772.9 MB/s Sequential read (64-bit), size = 2816 kB, loops = 47334, 26023.8 MB/s Sequential read (64-bit), size = 3072 kB, loops = 41916, 25142.8 MB/s Sequential read (64-bit), size = 3328 kB, loops = 37525, 24388.1 MB/s Sequential read (64-bit), size = 3584 kB, loops = 35982, 25184.6 MB/s Sequential read (64-bit), size = 4096 kB, loops = 31824, 25457.4 MB/s Sequential read (64-bit), size = 5120 kB, loops = 25128, 25116.7 MB/s Sequential read (64-bit), size = 6144 kB, loops = 22460, 26948.8 MB/s Sequential read (64-bit), size = 7168 kB, loops = 18081, 25309.1 MB/s Sequential read (64-bit), size = 8192 kB, loops = 14952, 23921.5 MB/s Sequential read (64-bit), size = 9216 kB, loops = 13692, 24642.6 MB/s Sequential read (64-bit), size = 10240 kB, loops = 12144, 24280.2 MB/s Sequential read (64-bit), size = 12288 kB, loops = 9465, 22713.4 MB/s Sequential read (64-bit), size = 14336 kB, loops = 7628, 21357.8 MB/s Sequential read (64-bit), size = 15360 kB, loops = 6580, 19735.0 MB/s Sequential read (64-bit), size = 16384 kB, loops = 6068, 19413.2 MB/s Sequential read (64-bit), size = 20480 kB, loops = 3636, 14541.5 MB/s Sequential read (64-bit), size = 21504 kB, loops = 3741, 15711.6 MB/s Sequential read (64-bit), size = 32768 kB, loops = 1266, 8102.1 MB/s Sequential read (64-bit), size = 49152 kB, loops = 900, 8640.0 MB/s Sequential read (64-bit), size = 65536 kB, loops = 566, 7238.3 MB/s Sequential read (64-bit), size = 73728 kB, loops = 609, 8765.8 MB/s Sequential read (64-bit), size = 98304 kB, loops = 455, 8726.8 MB/s Sequential read (64-bit), size = 131072 kB, loops = 331, 8461.2 MB/s

Источник

Оцените статью
Adblock
detector