J
J
jaffrey2017-02-22 10:42:40
linux
jaffrey, 2017-02-22 10:42:40

How to reduce RAM consumption and support many processes of one program?

You need to run many processes of one program. There is no way to rewrite it. You just need to make many launches (each process has its own settings), ideally up to 1000 on one machine. How can technically reduce memory consumption? I heard that you can make a partition in RAM, and in it a partition to simulate a hard disk and run from there so that you can support many processes at the same time, instead of running 500 processes directly. The program is a console application that runs on requests.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Moseychuk, 2017-02-22
@fshp

1) Several instances of the same application will use quite a lot of shared memory - application code pages and shared libraries will be present in memory in a single instance.
2) In Linux, there is a subsystem "KSM Page Migration" - a system for deduplicating pages of memory, on a large number of the same type of processes can significantly reduce the consumption of RAM.

X
x67, 2017-02-22
@x67

Look at how much the program consumes at the peak and write a startup script with different parameters so that no more than floor(ram/ramperprocess) of the program's processes work at the same time. And if the program is demanding on CPU resources, then it is better to limit this number to the number of cores / threads

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question