New on LowEndTalk? Please Register and read our Community Rules.
ask for /dev/shm + OpenVZ questions
Does it mean that this OpenVZ has a memory overselling.
[email protected]:/dev/shm# free -h
total used free shared buff/cache available
Mem: 6.0G 30M 5.3G 11M 711M 5.9G
Swap: 6.0G 0B 6.0G
[email protected]:/dev/shm# dd if=/dev/zero of=1.bin bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.431965 s, 2.5 GB/s
[email protected]:/dev/shm# free -h
total used free shared buff/cache available
Mem: 6.0G 2.0G 3.3G 1.0G 711M 3.9G
Swap: 6.0G 0B 6.0G
[email protected]:/dev/shm# rm 1.bin
[email protected]:/dev/shm# dd if=/dev/zero of=1.bin bs=1M count=6144
dd: error writing '1.bin': No space left on device
3073+0 records in
3072+0 records out
3221225472 bytes (3.2 GB, 3.0 GiB) copied, 1.32617 s, 2.4 GB/s
[email protected]:/dev/shm# free -h
total used free shared buff/cache available
Mem: 6.0G 5.3G 0B 3.0G 707M 609M
Swap: 6.0G 0B 6.0G
Comments
Default size of /dev/shm is half of your physical memory which is why your dd command couldn't write more than 3GiB.
I wrote 1GB to /dev/shm and it's taking up 2GB of memory, why?
I just remounted to RAM size, indeed I can write the whole disk, I will study why.
I think /dev/shm must pay the default fine.
The 1GB file that you wrote is showing correctly as 1.0G under "Shared" column. Rest of the used RAM constitutes file system buffers/cache (711M) plus the memory taken by your processes.
I understand this description.
I detected massive RAM overselling using a file in shm folder.
/run/shm
.If the file is actually in RAM, both read passes should have the same throughput.
In the paste below, the first read was 75% slower than the second read, which indicates that the first read was not from DRAM.
It might be in PMEM that is still considered RAM, but the processor on this server doesn't support Optane DIMM.
Therefore, I can only conclude the provider is selling disk-based SWAP as RAM,
Raw paste: Boomer.host sells SWAP as RAM