How can you transfer only one process whose memory is partly in swap space, completely in RAM (provided there is enough free RAM)?

Do not disable swap in the system, without changing the parameter vm.swappines, as this will affect all processes in the swap.

The reason is that there is a mysql process to which a large flow of requests is expected in the future and it is necessary that by a certain point in time it is completely in memory.

  • if it's not mysql, but still mysqld, then make an sql query for it. - aleksandr barakin
  • Yes, mysqld, but with the same success it could be another daemon request to which it would not be possible to make - GareevAydar
  • one
    kick it with some kind of signal - eri

1 answer 1

Too impractical idea. Mysql has an option -memlock and with it you can get rid of swapping.

If this is really so important, all memory data is accessible via the / proc / interface in linux. If you count all the bytes, then, obviously, all inactive contents of the swap will move into memory. Here are examples of such a program https://stackoverflow.com/questions/1401359/understanding-linux-proc-id-maps .

  • Please try to publish detailed answers containing a specific example of the minimum solution, supplementing them with a link to the source. Answers –references (as well as comments) do not add knowledge to the Runet. - Nicolas Chabanovsky