Requirement |
Where to get the information from |
CPU type the product is supported on |
/proc/cpuinfo |
CPU architecture (32 / 64 bits) |
|
machine model |
|
disk model |
/sys/bus/scsi/devices/0:0:0:0 for example info extraction can be built upon libsysfs |
Requirement |
Where to get the information from |
kernel version |
/proc/sys/kernel/osrelease take the 1st 3 digits
($(VERSION).$(PATCHLEVEL).$(SUBLEVEL)) e.g. in "2.6.9-1.667smp" only take "2.6.9" |
distribution |
/proc/version This file contains the string linux_banner, that is built as follows: "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n"; The LINUX_COMPILER variable (obtained by $(CC) -v should (don't know if it is always true?) contain the distro level: gcc -v | tail -1 gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) |
compiler version |
/proc/version (see above) |
Requirement |
Where to get the information from |
Number of sibling CPUs on the same physical CPU for architectures which use hyper-threading | /proc/cpuinfo
(siblings) |
Package
id of a logical CPU (if hyper-threading) |
/proc/cpuinfo
(physical id) |
Requirement |
Expressed in |
Where to get the information from |
Memory space |
KB or MB |
/proc/meminfo (MemTotal) |
Size
of a huge page |
kB |
/proc/meminfo
(Hugepagesize) |
Total
number
of huge pages |
# of
pages |
/proc/meminfo
(HugePages_Total) |
Total
number
of available huge pages |
# of
pages |
/proc/meminfo
(HugePages_Free) |
Requirement |
Expressed in |
Where to get the information from |
Swap space |
KB or MB or percentage of the memory space |
/proc/meminfo (SwapTotal) |
Requirement |
Where to get the information from |
Free disk space |
statfs() |
Disk size limitation (max size supported for GPFS) |
/proc/partitions |
Parameter |
Where to set / get the value |
Maximum number of shm segment ids |
/proc/sys/kernel/shmmni |
Maximum shm segment size (in bytes) |
/proc/sys/kernel/shmmax |
Maximum number of shm segment pages system-wide |
/proc/sys/kernel/shmall |
Minimum shm segment size (in bytes) |
ipcs -lm / shmctl(SHMINFO)->shmmin |
Parameter |
Where to set the value |
Maximum size of a message queue |
/proc/sys/kernel/msgmnb |
Maximum number of message queue ids |
/proc/sys/kernel/msgmni |
Parameter |
Where to set the value |
Max number of semaphore identifiers (semmni) |
/proc/sys/kernel/sem (4th field) |
Max number of semaphores per id (semmsl) |
/proc/sys/kernel/sem (1st field) |
Max number of semaphores in system (semmns = semmni * semmsl) |
/proc/sys/kernel/sem (2nd field) |
Max number of operations per semop call (semopm) |
/proc/sys/kernel/sem (3rd field) |
All previous parameters together |
/proc/sys/kernel/sem |
Parameter |
Where to set the value |
Maximum number of file handles |
/proc/sys/fs/file-max |
Parameter |
Where to set the value |
Maximum receive buffer size |
/proc/sys/net/core/rmem_max |
Maximum send buffer size |
/proc/sys/net/core/wmem_max |
Maximum number of received packets that will be processed
before resulting in congestion |
/proc/sys/net/core/netdev_max_backlog |
Minimum / default / maximum memory size of the TCP receive
buffers |
/proc/sys/net/ipv4/tcp_rmem |
Minimum / default / maximum memory size of the TCP send
buffers |
/proc/sys/net/ipv4/tcp_wmem |
Enable TCP to negotiate the use of window scaling (> 64K
buffers) with the other end during connection setup |
/proc/sys/net/ipv4/tcp_window_scaling |
Timeout
for a FIN packet before the socket is forcibly closed |
/proc/sys/net/ipv4/tcp_fin_timeout |
Maximum
number of queued connection requests which= have still not received an
ACK from the connecting client |
/proc/sys/net/ipv4/tcp_max_syn_backlog |
Allow
to reuse TIME-WAIT sockets for new connections |
/proc/sys/net/ipv4/tcp_tw_reuse |
Local port range that is used by TCP and UDP to choose the
local port |
/proc/sys/net/ipv4/ip_local_port_range |
MTU size |
ifconfig or /proc/sys/net/ipv6/conf/<interface>/mtu |
Parameter |
Expressed
in |
Where to set the value |
Kernel policy for memory allocation |
0, 1, 2 |
/proc/sys/vm/overcommit_memory |
Percentage
of the memory that should be added to the swap to determine the maximum
address space that is allowed to be committed |
Percentage
of the physical memory |
/proc/sys/vm/overcommit_ratio |
Swappiness |
[0,
100] |
/proc/sys/vm/swappiness |
Number
of
configured huge pages |
Number
of
pages |
/proc/sys/vm/nr_hugepages |
Parameter |
Default value |
How to set the value (command level) |
How to set value (syscall
level) |
Number of open file descriptors (hard limit) |
_SC_OPEN_MAX |
ulimit -Hn Note: should be set to less than /proc/sys/fs/file-max |
setrlimit(RLIMIT_NOFILE) |
Number of open file descriptors (soft limt) |
_SC_OPEN_MAX |
ulimit -Sn |
setrlimit(RLIMIT(NOFILE) |
Maximum number of processes (hard limit) |
_SC_CHILD_MAX |
ulimit -Hu |
setrlimit(RLIMIT_NPROC) |
Maximum number of processes (soft limit) |
_SC_CHILD_MAX |
ulimit -Su |
setrlimit(RLIMIT_NPROC) |
Maximum stack size (soft limit) |
_STK_LIM |
ulimit -Ss |
setrlimit(RLIMIT_STACK) |
Maximum size of the data segment (soft limit) |
unlimited (RLIM_INFINITY) |
ulimit -Sd |
setrlimit(RLIMIT_DATA) |
Maximum size of virtual memory (soft limit) |
(datalim / 1024L) + (stacklim / 1024L) |
ulimit -Sv |
setrlimit(RLIMIT_RSS) |
Parameter |
Where to set the value |
Base address for shared libraries (specific to some ditros,
like RH) |
/proc/<pid>/mapped_base |
Parameter |
Where to set the value |
Time
spent
in user mode |
/proc/stat
(column 1 + column 2) |
Time
spent
in kernel mode |
/proc/stat
(column 3) |
Time
spent
idle |
/proc/stat
(column 4) |
Number
of
context switches |
/proc/stat
(ctxt) |
Free
memory |
/proc/meminfo
(MemFree) |
Total
amount
of swap space |
/proc/meminfo
(SwapTotal) |
Free
swap
area |
/proc/meminfo
(SwapFree) |
Network
device statistics |
/proc/net/dev |
Parameter |
Where to set the value |
Status information about a given process |
/proc/<pid>/stat |
Characteristics of the underlying object |
Example |
attributes |
location |
field
number or line delimiter |
strategy
routine |
||
data
format |
name
scope |
contents
scope |
|||||
Existing routine |
system
wide |
N/A |
min
shm segment size |
N/A |
N/A |
N/A |
strat_shmmin |
Entire file contents |
system
wide |
system wide |
max
number of shm segment ids |
ATTR_NAME_SYS_WIDE
| ATTR_CONT_SYS_WIDE |
/proc/sys/kernel/shmmni |
N/A |
strat_file |
per
process |
system wide |
Shared
libraries base address for a process |
ATTR_NAME_PER_PROC | ATTR_CONT_SYS_WIDE |
/proc/%d/mapped_base |
N/A |
strat_file |
|
per
network interface |
system wide |
MTU
size |
ATTR_NAME_PER_NETINT | ATTR_CONT_SYS_WIDE |
/proc/sys/net/ipv6/conf/%s/mtu |
N/A |
strat_file |
|
single line |
system
wide |
system wide |
max
number of semaphores per id |
ATTR_NAME_SYS_WIDE | ATTR_CONT_SYS_WIDE |
/proc/sys/kernel/sem |
1 |
strat_sub_file_line |
per
process |
system wide |
ppid
of a process |
ATTR_NAME_PER_PROC | ATTR_CONT_SYS_WIDE |
/proc/%d/stat |
4 |
strat_sub_file_line | |
one line of
data per single object |
system wide |
per network
interface |
Number
of receive packets for a network interface |
ATTR_NAME_SYS_WIDE
| ATTR_CONT_PER_NETINT |
/proc/net/dev |
2 |
strat_sub_file_lines |
several lines, each line containing a
fixed string followed by the corresponding value |
system
wide |
system wide |
Total
swap space |
ATTR_NAME_SYS_WIDE | ATTR_CONT_SYS_WIDE | /proc/meminfo |
"SwapTotal" |
strat_sub_file_block |
per
process |
system wide |
Sleep
average time of a process |
ATTR_NAME_PER_PROC | ATTR_CONT_SYS_WIDE |
/proc/%d/status |
"SleepAVG" |
strat_sub_file_block | |
block
of data for each object |
system
wide |
per CPU |
Package
id of a cpu |
ATTR_NAME_SYS_WIDE | ATTR_CONT_PER_CPU |
/proc/cpuinfo |
"physical
id" |
strat_sub_file_block |
Database |
contains |
Distro-independent
corresponding database |
TUNDB_S1_1 |
the set of distro-dependent tunables that enables access to static objects (various strategy routines) | TUNDB_S1 |
TUNDB_S2_1 |
the set of
distro-dependent tunables that enables access to parts of dynamic
objects through strat_get_subfile_line /
strat_set_subfile_line: gets / sets a field within a line inside files
that are made of a single line. |
TUNDB_S2 |
TUNDB_S3_1 |
the set of
distro-dependent tunables that enables access to parts of dynamic
objects through strat_get_subfile_lines /
strat_set_subfile_lines: gets / sets a field within a line inside files
that are made of several lines, each line containing a given identifier |
TUNDB_S3 |
TUNDB_S4_1 |
the set of
distro-dependent tunables that enables access to parts of
dynamic objects through strat_get_subfile_block /
strat_set_subfile_block: gets / sets a value in files made of a single
block of data. This block of data is made of several lines that contain
an identifier and the actual value. |
TUNDB_S4 |
TUNDB_S5_1 |
the set of
distro-dependent tunables that enables access to parts of
dynamic objects through strat_get_subfile_blocks /
strat_set_subfile_blocks: gets / sets a value in files made of several
blocks of data. Each block of data is identified by a unique
identifier, and it is made of several lines that contain an identifier
and the actual value. |
TUNDB_S5 |
TUNDB_S6_1 |
the set of distro-dependent tunables that enables access to the entire contents of dynamic objects | TUNDB_S6 |
Most of the Linux distributions maintain release information file in the “/etc/” directory. Here is the list of files on some of the well known Linux distributions:
Novell SuSE | /etc/SuSE-release |
Red Hat | /etc/redhat-release, /etc/redhat_version |
Fedora | /etc/fedora-release |
Debian | /etc/debian_release, /etc/debian_version, |
Mandrake | /etc/mandrake-release |
Gentoo | /etc/gentoo-release |
Kernel |
SuSE
Distros |
Associated
path within the sources |
Red
Hat distros |
Associated
path within the sources |
2.6.5 |
SLES9 |
base-2.6.5/distro-SUSE/SLES/9 |
FC2 |
base-2.6.5/distro-REDHAT/FC/2 |
2.6.9 |
FC3 RHEL4 |
base-2.6.5/distro-REDHAT/FC/3 base-2.6.5/distro-REDHAT/RHEL/4 |
||
2.6.11 |
(Open)
SuSE 9.3 |
base-2.6.11/distro-SUSE/SL/9.3 |
FC4 |
base-2.6.11/distro-REDHAT/FC/4 |
2.6.13 |
(Open)
SuSE 10.0 |
base-2.6.13/distro-SUSE/SL/13 | FC5 |
base-2.6.13/distro-REDHAT/FC/5 |
Directory |
contains |
will be
linked to |
include |
the common
include files, i.e. kernel / distro independent |
N/A |
include/base-2.6.9 |
the include
files that are kernel release dependent |
include/base |
include/base-2.6.9/distro-REDHAT/FC/3 |
the include
files that are specific to the Fedora Core 3 distribution |
include/base/distro |
File | contains |
includes |
installed
under |
include/libtune.h | the
prototypes for the libtune interfaces. This is the only part that is
kernel / distro independent |
<base/libtune_base.h> | /usr/include |
include/base-2.6.9/libtune_base.h | the
constants definitions for the tunables specific to the 2.6.9 standard
kernel release. These are the tunables that are not distro / family
dependent |
<distro/libtune_distro.h> | /usr/include/base |
include/base-2.6.9/distro-REDHAT/FC/3/libtune_distro.h | the
constants definitions for the tunables specific to the Fedora Core 3
distribution. These are the tunables that are distro / family dependent |
N/A |
/usr/include/base/distro |
include/libtune_priv.h | private
stuff for the libtune library, that are kernel / distro independent:
structures, various internal constants, internal functions prototypes |
<base/libtune_priv_base.h> | Not installed |
include/base-2.6.9/libtune_priv_base.h | the
constants definitions that are specific to the 2.6.9 standard kernel
release: help strings and files locations for the tunables that are
defined in include/base-2.6.9/libtune_base.h |
<distro/libtune_priv_distro.h> | Not installed |
include/base-2.6.9/distro-REDHAT/FC/3/libtune_priv_distro.h | the
constants definitions that are specific to the Fedora Core 3
distribution: help strings and files locations for the tunables defined
in include/base-2.6.9/distro-REDHAT/FC/3/ libtune_distro.h |
N/A | Not installed |
Directory |
contains |
lib |
the kernel /
distro independent source files |
distro-lib/base-2.6.9 |
the source
files that are kernel release dependent |
distro-lib/base-2.6.9/distro-REDHAT/FC/3 |
the source
files that are specific to the Fedora Core 3 distribution |
File |
contains |
lib/libtundb.c |
The
initialization of TUNDB_D and TUNLIMITS (to NULL). This is the only
part that is kernel / distro independent |
distro-lib/base-2.6.9/libtundb_base.c |
The
initialization of TUNDB_S1 to TUNDB_S6. These
are the arrays that are not distro / family dependent |
distro-lib/base-2.6.9/distro-REDHAT/FC/3/libtundb_distro.c |
The initialization of TUNDB_S1_1 to TUNDB_S6_1. These are the tunables that are distro / family dependent |
lib/libtuninit.c | The storage
of TUNLIMITS into the mapped files |
distro-lib/base-2.6.9/libtuninit_base.c |
The
initialization of TUNLIMITS for the indexes that are not distro /
family dependent (i.e. for the indexes that correspond to TUNDB_S1 to
TUNDB_S6). |
distro-lib/base-2.6.9/distro-REDHAT/FC/3/libtuninit_distro.c |
The
initialization of TUNLIMITS for the indexes that are distro / family
dependent (i.e. for the indexes that correspond to TUNDB_S1_1 to
TUNDB_S6_1) |
cmd |
returned
value on success |
returned
value on failure |
TUN_INIT |
0 |
-1 |
TUN_CLEAN |
0 |
-1 |
TUN_ADD |
>=
0 (associated keyword = D_IDX_FIRST + new index) |
-1 |
TUN_REMOVE |
0 |
0 |