Документация PHP


posix_getpwuid

posix_getsid

POSIX Функции

PHP Manual


posix_getrlimit

(PHP 4, PHP 5)

posix_getrlimit — Return info about system resource limits

Описание

array posix_getrlimit ( void )

posix_getrlimit() returns an array of information about the current resource's soft and hard limits.

Each resource has an associated soft and hard limit. The soft limit is the value that the kernel enforces for the corresponding resource. The hard limit acts as a ceiling for the soft limit. An unprivileged process may only set its soft limit to a value from 0 to the hard limit, and irreversibly lower its hard limit.

Возвращаемые значения

Returns an associative array of elements for each limit that is defined. Each limit has a soft and a hard limit.

List of possible limits returned
Limit name Limit description
core The maximum size of the core file. When 0, not core files are created. When core files are larger than this size, they will be truncated at this size.
totalmem The maximum size of the memory of the process, in bytes.
virtualmem The maximum size of the virtual memory for the process, in bytes.
data The maximum size of the data segment for the process, in bytes.
stack The maximum size of the process stack, in bytes.
rss The maximum number of virtual pages resident in RAM
maxproc The maximum number of processes that can be created for the real user ID of the calling process.
memlock The maximum number of bytes of memory that may be locked into RAM.
cpu The amount of time the process is allowed to use the CPU.
filesize The maximum size of the data segment for the process, in bytes.
openfiles One more than the maximum number of open file descriptors.

Примеры

Пример #1 Example use of posix_getrlimit()

<?php

$limits 
posix_getrlimit();

print_r($limits);
?>

Результатом выполнения данного примера будет что-то подобное:

Array
(
    [soft core] => 0
    [hard core] => unlimited
    [soft data] => unlimited
    [hard data] => unlimited
    [soft stack] => 8388608
    [hard stack] => unlimited
    [soft totalmem] => unlimited
    [hard totalmem] => unlimited
    [soft rss] => unlimited
    [hard rss] => unlimited
    [soft maxproc] => unlimited
    [hard maxproc] => unlimited
    [soft memlock] => unlimited
    [hard memlock] => unlimited
    [soft cpu] => unlimited
    [hard cpu] => unlimited
    [soft filesize] => unlimited
    [hard filesize] => unlimited
    [soft openfiles] => 1024
    [hard openfiles] => 1024
)

Примечания

Замечание: This is a not POSIX function, but is common on BSD and System V systems. If the system does not support this function, then it will not be included at compile time. This may be checked with function_exists().

Смотрите также

  • man page GETRLIMIT(2)


posix_getpwuid

posix_getsid

POSIX Функции

PHP Manual

SAPE все усложнил?

MainLink - простая и прибыльная продажа ссылок!

Последние поступления:

Размещена 10 августа 2020 года

Я по ТВ видел, что через 10 лет мы будем жить лучше, чем в Германии...
Я не понял, что это они с Германией сделать хотят?!

читать далее…

ТехЗадание на Землю

Размещена 14 марта 2018 года

Пpоект Genesis (из коpпоpативной пеpеписки)

читать далее…

Шпаргалка по работе с Vim

Размещена 05 декабря 2017 года

Vim довольно мощный редактор, но работа с ним не всегда наглядна.
Например если нужно отредактировать какой-то файл например при помощи crontab, без знания специфики работы с viv никак.

читать далее…

Ошибка: Error: Cannot find a valid baseurl for repo

Размещена 13 сентабря 2017 года

Если возникает ошибка на centos 5 вида
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/

читать далее…

Linux Optimization

Размещена 30 июля 2012 года

Prelink

читать далее…