NaviServer - programmable web server
4.99  5.0

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

ns_rlimit(n) 5.0.0a naviserver "NaviServer Built-in Commands"

Name

ns_rlimit - Get or set resource limit in the operating system

Table Of Contents

Synopsis

Description

This command allows one to query or set the resource limits specified in the operating system for the current process. The command is named after the getrlimit/setrlimit call available on most unix-like systems. The commands returns on success a pair of values, which are the soft and hard limit for a specified resource (see below for the interfaced resources). The command allows only to change the soft limit. The specified value might be an integer or the constant unlimited.

A typical use case for this command is to query or set e.g. the coresize via the NaviServer configuration file or at run time in a syntax independent of the naming and conventions in the various startup scripts (e.g. upstart, systemd, ...).

COMMANDS

ns_rlimit coresize ?value?

Get or set the maximum size of core file created on program aborts. When 0 no core dump files are created. When nonzero, larger dumps are truncated to this size.

ns_rlimit datasize ?value?

Get or set the maximum size of the process's data segment.

ns_rlimit files ?value?

Get or set the maximum number of file descriptor number that can be opened by this process.

ns_rlimit filesize ?value?

Get or set the maximum size of files that the process may create.

ns_rlimit vmsize ?value?

Get or set the maximum size of the process's virtual memory (address space) in bytes.

EXAMPLES

When the server is for some reason in an unknown state, the command ns_rlimit can be used to force a core dump via ns_crash also for running processes, which were started with a core dump limit of 0.

 % ns_rlimit coresize unlimited
 unlimited unlimited
 % ns_crash

Keywords

global built-in, limits, system