During upgrades Bundler uses a lot of memory in relation to the rest of the installation during the assets precompilation. This would hint at some VM object refcount thing not releasing the touched objects (files having been read in?) and thus the GC not firing and doing its job. Most likely this is an artefact of either Bundler itself or the Rails asset pipeline.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3952 1000 20 0 3636888 651740 14836 R 86,8 31,8 2:23.24 bundle
3433 1000 20 0 1681992 190036 4776 S 0,0 9,3 0:05.55 ruby
3403 1000 20 0 1688156 172824 4812 S 0,0 8,4 0:05.95 ruby
3391 1000 20 0 1687128 143528 5100 S 0,0 7,0 0:05.95 ruby
3366 1000 20 0 510236 105780 4528 S 0,3 5,2 0:02.84 ruby
2920 1000 20 0 465132 92584 6804 S 0,0 4,5 0:11.59 ruby
For your consideration to maybe take a deeper look at this, as it is causing annoying shuffling for sysadmins with other processes on servers at upgrade times if the servers are provisioned for the runtime memory requirements.
I figured you would hit this bit of juggling on your hosted services and hoped you would have cooked up a pattern in-house.
If you have a public ticket on an open source component for that at some point, do cross post here - I’m willing to help tackle this (design-side, implementation-side, just general input, metrification, testing).
Otherwise may the UNIX pipe (or Goroutine or equivalent) be with you.
Des progrès sur ce problème ? Nous constatons que 14 Go de mémoire sont alloués lors de la création d’une instance VIDE de 3.2.1 avant qu’elle ne manque de mémoire et ne plante.
Pourriez-vous partager la sortie de vmstat 5 dans ce cas ? Si vous regardez ps ou top, vous pourriez voir quelque chose d’autre que la mémoire en cours d’utilisation. La mémoire allouée n’est pas si importante si elle n’est pas utilisée.
Par exemple, dans la sortie de ps, je vois VSZ et RSS. Je me soucie du RSS.
Dans top, je vois la même chose mais c’est appelé VIRT et RES
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2284 ddiscou+ 25 5 5246644 327496 5640 S 1.7 16.4 872:50.70 ruby
2294 ddiscou+ 20 0 5126600 364284 14436 S 0.7 18.3 91:00.13 ruby
vmstat me dit quelle est la pression mémoire actuelle - combien d’espace d’échange reste, combien de mémoire libre et de mémoire tampon, et surtout s’il y a un swap-in (la colonne si)
root@ubuntu-2gb-nbg1-1:~# vmstat 5 5
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 239616 127080 185428 464448 0 0 14 32 4 2 2 1 97 0 0
0 0 239616 124584 185432 464500 0 0 0 13 138 318 2 2 96 0 0
0 0 239616 126120 185436 464500 0 0 0 13 116 264 1 0 99 0 0
0 0 239616 120376 185436 464504 0 0 0 46 125 322 3 2 95 0 0
0 0 239616 123448 185436 464504 0 0 0 73 129 306 1 1 98 0 0