Re: [Proftpd-user] RLimitMemory question

Bob Friesenhahn <[email protected]>
Newsgroups gmane.network.proftpd.user
Message-ID <[email protected]>
On Mon, 13 Aug 2018, Ian via Proftp-user wrote:
>
> Immediate after logging in, i looked at htop and it showed that the authenticated proftpd process is using up 196MB of Virtual memory .    if each session takes up 196MB of VM inside an 8GB RAM server, at most we can support is 47 concurrent sessions? 
>
> What's a strategy to scale up without adding a lot of hardware?  use a large swap space ? 

Virtual memory is "virtual" (just a number!) and thus it does not 
necessarily consume any RAM.

It may be that the RLimitMemory feature is not very effective since it 
is based on virtual memory (address space) rather than the actual 
memory used.

Much of the virtual memory is shared with other processes (e.g. all 
the shared library and executable read-only text and writeable 
initialized data "BSS" which has not been modified) and so adding more 
processes does not substantially increase the actual amount of RAM 
used.  In a forking server, the child process which provides the 
service shares unmodified memory pages with its parent process (e.g. 
Proftpd) and depending on server implementation, the child might not 
use much more RAM.  Virtual memory is typically allocated in 4k blocks 
and the child needs some blocks for its own stack and might burn a 4k 
block for each shared library used.

If this is a Linux system, then you can examine /proc/[pid]/smaps to 
see where the memory in the child process is attributed to and if it 
is private or shared with other processes.  Read-only shared data does 
not multiply with added sessions.

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
ProFTPD Users List   <[email protected]>
Unsubscribe problems?
http://www.proftpd.org/list-unsub.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.