J'ai identifié un problème avec des vitesses de mémoire et de la latence sur mon serveur. Je loue ce serveur à partir de OVH et une de leurs exigences avant d'obtenir le RAM remplacé est
Pour lancer une intervention, vous devez envoyer des journaux dans votre ticket montrant l'identifiant et le fichier affecté RAM.
Comment puis-je détecter la puce DRAM qui est défectueuse sans exécuter MEMTEST86 + pendant des jours, car il s'agit d'un grand serveur de production (1 To RAM).
sysbench --Test = Mémoire --Memory-Block-Taille = 4G --Memory-Total-taille = 32G RUN
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
sysbench 1.0.18 (using system LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time
Running memory speed test with the following options:
block size: 4194304KiB
total size: 32768MiB
operation: write
scope: global
Initializing worker threads...
Threads started!
Total operations: 2 ( 0.15 per second)
8192.00 MiB transferred (630.16 MiB/sec)
General statistics:
total time: 12.9937s
total number of events: 2
Latency (ms):
min: 6338.94
avg: 6496.29
max: 6653.64
95th percentile: 6594.16
sum: 12992.58
Threads fairness:
events (avg/stddev): 2.0000/0.00
execution time (avg/stddev): 12.9926/0.00
sysbench --Test = Mémoire --Memory-Block-Taille = 1k --Memory-Total-Taille = 100g --Num-threads = 1 course
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
sysbench 1.0.18 (using system LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time
Running memory speed test with the following options:
block size: 1KiB
total size: 102400MiB
operation: write
scope: global
Initializing worker threads...
Threads started!
Total operations: 48693603 (4868132.10 per second)
47552.35 MiB transferred (4754.04 MiB/sec)
General statistics:
total time: 10.0002s
total number of events: 48693603
Latency (ms):
min: 0.00
avg: 0.00
max: 0.47
95th percentile: 0.00
sum: 4155.88
Threads fairness:
events (avg/stddev): 48693603.0000/0.00
execution time (avg/stddev): 4.1559/0.00
Sudo lshw -short -c mémoire
H/W path Device Class Description
==========================================================
/0/0 memory 64KiB BIOS
/0/20 memory 1TiB System Memory
/0/20/0 memory [empty]
/0/20/1 memory 128GiB DIMM DDR4 Synchronous LRDIMM 2933 MHz (0.3 ns)
/0/20/2 memory [empty]
/0/20/3 memory 128GiB DIMM DDR4 Synchronous LRDIMM 2933 MHz (0.3 ns)
/0/20/4 memory [empty]
/0/20/5 memory 128GiB DIMM DDR4 Synchronous LRDIMM 2933 MHz (0.3 ns)
/0/20/6 memory [empty]
/0/20/7 memory 128GiB DIMM DDR4 Synchronous LRDIMM 2933 MHz (0.3 ns)
/0/20/8 memory [empty]
/0/20/9 memory 128GiB DIMM DDR4 Synchronous LRDIMM 2933 MHz (0.3 ns)
/0/20/a memory [empty]
/0/20/b memory 128GiB DIMM DDR4 Synchronous LRDIMM 2933 MHz (0.3 ns)
/0/20/c memory [empty]
/0/20/d memory 128GiB DIMM DDR4 Synchronous LRDIMM 2933 MHz (0.3 ns)
/0/20/e memory [empty]
/0/20/f memory 128GiB DIMM DDR4 Synchronous LRDIMM 2933 MHz (0.3 ns)
/0/23 memory 3MiB L1 cache
/0/24 memory 24MiB L2 cache
/0/25 memory 256MiB L3 cache
C'est plus un long commentaire qu'une réponse. Peut-être que cela stimulera d'autres suggestions. L'idée de base étant de réserver et d'allouer de la mémoire telle que Sysbench doit ensuite utiliser une zone de mémoire différente de sa mémoire tampon de blocage pour observer si la performance est la même sur toute la mémoire.
Le système de test n'a que 32 g de mémoire sur 4x8g DIMMS.
Premièrement, il suffit d'exécuter Sysbench normalement, mais augmentez la durée du test suffisamment de temps pour acquérir des informations lorsqu'il exécute:
doug@s19:~/c$ sysbench --test=memory --memory-block-size=4G --memory-total-size=512G --num-threads=1 --time=60 run
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
sysbench 1.0.18 (using system LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time
Running memory speed test with the following options:
block size: 4194304KiB
total size: 524288MiB
operation: write
scope: global
Initializing worker threads...
Threads started!
Total operations: 128 ( 3.05 per second)
524288.00 MiB transferred (12509.51 MiB/sec)
General statistics:
total time: 41.9101s
total number of events: 128
Latency (ms):
min: 327.22
avg: 327.42
max: 328.09
95th percentile: 325.98
sum: 41909.72
Threads fairness:
events (avg/stddev): 128.0000/0.00
execution time (avg/stddev): 41.9097/0.00
Et pendant les 41 secondes que le test a pris pour exécuter et dans un autre terminal, je l'ai fait:
doug@s19:~$ ps aux | grep sysbench
doug 10489 92.2 12.8 4227496 4204436 pts/1 Sl+ 09:48 0:03 sysbench --test=memory --memory-block-size=4G --memory-total-size=512G --num-threads=1 --time=60 run
doug 10492 0.0 0.0 9040 732 pts/2 S+ 09:48 0:00 grep --color=auto sysbench
doug@s19:~$ pmap 10489 | grep anon | grep " 4195"
00007f25cbb5a000 4195456K rw--- [ anon ]
J'ai fait tout le cycle à quelques reprises:
00007fa4bd7b4000 4195456K rw--- [ anon ]
00007f32c9878000 4195456K rw--- [ anon ]
00007f4837211000 4195456K rw--- [ anon ]
ce qui montre que nous ne savons vraiment pas quelle mémoire est utilisée ou la mappage à la DIMM. Continuons de toute façon.
EDIT: Ce qui précède peut être repensé répétable, en désactivant la mise en page de la mise en page d'espace d'adresse Randomisation (ASLR):
Sudo sysctl kernel.randomize_va_space=0
Maintenant, réservez un morceau de mémoire afin de forcer la mémoire tampon Sysbench à être allouée ailleurs. Quelqu'un pourrait avoir une meilleure idée, mais j'ai écrit un programme:
doug@s19:~/c$ cat reservem.c
/*****************************************************************************
*
* reservem.c 2021.07.20 Smythies
* allocate a chunk of memory for a while.
* current use is to force another program to use a different area
* of memory.
* see also: https://askubuntu.com/questions/1352756/ram-has-become-very-slow-low-write-speed-and-high-latency
* see slao testm.c from which this code started.
*
*****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(){
char *fptr;
long i, k;
/* Adjust as needed for use requirements */
i = 8589934592;
if(( fptr = (char *)malloc(i)) == NULL){
printf("reservem: memory allocation failed, Exiting...\n");
exit(-1);
}
while (( fptr == NULL) && (i > 0));
for(k = 0; k < i; k++){ /* so that the memory really gets allocated and not just reserved */
fptr[k] = (char) (k & 255);
} /* endfor */
printf("reservem: memory reserved and allocated. now sleeping...\n");
sleep(180); /* so other tests and observation can be done. Adjust as required. */
free(fptr);
printf("reservem: memory has been set free. Done and exiting...\n");
return(0);
} /* endprogram */
Compilé:
doug@s19:~/c$ cc reservem.c -o reservem
ensuite, passez-la, puis repudiez les étapes précédentes pendant que le bloc de mémoire était réservé et attribué. Obtenir:
doug@s19:~$ ps aux | grep sysbench
doug 11324 93.8 12.8 4227496 4204340 pts/1 Sl+ 13:58 0:09 sysbench --test=memory --memory-block-size=4G --memory-total-size=512G --num-threads=1 --time=60 run
doug 11327 0.0 0.0 9040 664 pts/2 S+ 13:59 0:00 grep --color=auto sysbench
doug@s19:~$ pmap 11324 | grep anon | grep " 4195"
00007fc5f2df8000 4195456K rw--- [ anon ]
Et pour la mémoire réservée:
doug@s19:~$ ps aux | grep reservem
doug 11314 55.0 25.6 8391108 8389584 pts/0 S+ 13:57 0:11 ./reservem
doug 11318 0.0 0.0 9040 740 pts/2 S+ 13:57 0:00 grep --color=auto reservem
doug@s19:~$ pmap 11314 | grep anon | grep " 8388612K"
00007f11a6bfc000 8388612K rw--- [ anon ]
Et:
524288.00 MiB transferred (12499.79 MiB/sec)
De même pour réserver et allouer 2 et 3 fois 8g:
doug@s19:~$ ps aux | grep reservem
doug 11335 85.0 25.6 8391108 8389704 pts/0 S 14:07 0:11 ./reservem
doug 11336 92.0 25.6 8391108 8389672 pts/0 S 14:07 0:11 ./reservem
doug 11340 0.0 0.0 9040 736 pts/2 S+ 14:08 0:00 grep --color=auto reservem
doug@s19:~$ pmap 11335 | grep anon | grep " 8388612K"
00007fae2ce3f000 8388612K rw--- [ anon ]
doug@s19:~$ pmap 11336 | grep anon | grep " 8388612K"
00007f20cb627000 8388612K rw--- [ anon ]
doug@s19:~$ ps aux | grep sysbench
doug 11347 96.6 12.8 4227496 4204468 pts/1 Sl+ 14:08 0:12 sysbench --test=memory --memory-block-size=4G --memory-total-size=512G --num-threads=1 --time=60 run
doug 11350 0.0 0.0 9040 740 pts/2 S+ 14:08 0:00 grep --color=auto sysbench
doug@s19:~$ pmap 11347 | grep anon | grep " 4195"
00007f37dbe3c000 4195456K rw--- [ anon ]
et:
524288.00 MiB transferred (12521.74 MiB/sec)
3x:
doug@s19:~$ ps aux | grep reservem
doug 11388 100 21.0 8391108 6889064 pts/0 R 14:12 0:09 ./reservem
doug 11389 103 19.2 8391108 6292368 pts/0 R 14:12 0:08 ./reservem
doug 11390 100 16.3 8391108 5334328 pts/0 R 14:12 0:07 ./reservem
doug 11392 0.0 0.0 9040 724 pts/2 S+ 14:12 0:00 grep --color=auto reservem
doug@s19:~$ pmap 11388 | grep anon | grep " 8388612K"
00007f2b83d2d000 8388612K rw--- [ anon ]
doug@s19:~$ pmap 11389 | grep anon | grep " 8388612K"
00007f2921e0c000 8388612K rw--- [ anon ]
doug@s19:~$ pmap 11390 | grep anon | grep " 8388612K"
00007f2a23f2b000 8388612K rw--- [ anon ]
doug@s19:~$ ps aux | grep sysbench
doug 11402 107 12.8 4227496 4204420 pts/1 Sl+ 14:12 0:07 sysbench --test=memory --memory-block-size=4G --memory-total-size=512G --num-threads=1 --time=60 run
doug 11405 0.0 0.0 9040 672 pts/2 S+ 14:12 0:00 grep --color=auto sysbench
doug@s19:~$ pmap 11402 | grep anon | grep " 4195"
00007fe64b54b000 4195456K rw--- [ anon ]
et:
524288.00 MiB transferred (12504.34 MiB/sec)
Pour référence, Performances sur ce système Vers Taille de la mémoire:
Block-size: performance (MiB/sec):
256 2750.99
512 4937.70
1K 8216.82
2K 12290.93
4K 16334.92
8K 19498.37
16K 21663.68
32K 22514.94
64K 23372.45
128K 23815.14
256K 23967.98
512K 24126.43
1M 24226.70
2M 24279.93
4M 24310.19
8M 23632.07
16M 20622.04
32M 16149.71
64M 14206.06
128M 13303.15
256M 12853.12
512M 12720.34
1G 12584.68
2G 12538.66
4G 12502.66
8G 12490.63
16G 12482.25