Difference between revisions of "ProcFS"
From Linux-VServer
UdoBurghardt (Talk | contribs) |
UdoBurghardt (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | Information abaut the current runtime conditions can be found inside the /proc directory. The very most information is read-only. Because it usually is world-readable you do not have to gain root access to look at this information. | + | Information abaut the current runtime conditions can be found inside the /proc directory. The very most information is read-only. Because it usually is world-readable you do not have to gain root access to look at this information. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
== Per Host == | == Per Host == |
Revision as of 13:04, 16 October 2006
Information abaut the current runtime conditions can be found inside the /proc directory. The very most information is read-only. Because it usually is world-readable you do not have to gain root access to look at this information.
Contents |
Per Host
Regarding the host system there is only one file present:
info
/proc/virtual/info VCIVersion: 0002:0002 VCISyscall: 236 VCIKernel: 03000016
You may compare this info to the output of "vserver-info"; you will recognize two of those entries under a slightly different name while VCIKernel seems to be missing:
x2:~# vserver-info Versions: Kernel: 2.6.17-2-vserver-amd64 VS-API: 0x00020002 util-vserver: 0.30.210; Sep 30 2006, 23:55:41 Features: CC: gcc, gcc (GCC) 4.1.2 20060928 (prerelease) (Debian 4.1.1-15) CXX: g++, g++ (GCC) 4.1.2 20060928 (prerelease) (Debian 4.1.1-15) CPPFLAGS: CFLAGS: '-Wall -g -O2 -std=c99 -Wall -pedantic -W -funit-at-a-time' CXXFLAGS: '-g -O2 -ansi -Wall -pedantic -W -fmessage-length=0 -funit-at-a-time' build/host: x86_64-pc-linux-gnu/x86_64-pc-linux-gnu Use dietlibc: yes Build C++ programs: yes Build C99 programs: yes Available APIs: compat,v11,fscompat,v13,net,oldproc,olduts ext2fs Source: e2fsprogs syscall(2) invocation: alternative vserver(2) syscall#: 236/glibc
Per vserver instance
info
This shows the context id, vx_info location and init pid
/proc/virtual/<id>/info ID: 1001 Info: 83c37000 Init: 0
status
This contains the usage count (references) and task count, as well as the context flags, capability boundary and context capabilities
/proc/virtual/<id>/status UseCnt: 38 Tasks: 16 Flags: 0000000000000000 BCaps: 00000000d46c04ff CCaps: 0000000000000000 Ticks: 0
sched
Shows the current amount of tokens, scheduler parameters (fill rate, interval, min/max), the priority bias and the calculated vavavoom (priority bonus)
/proc/virtual/<id>/sched Token: 0 FillRate: 1 Interval: 4 TokensMin: 6 TokensMax: 50 PrioBias: 0 VaVaVoom: 0 cpu 0: 0 0 0
cacct
This one accounts socket messages for the listed protocols, as incoming messages/bytes and outgoing messages/bytes
/proc/virtual/<id>/cacct UNSPEC: 0/0 0/0 0/0 UNIX: 35/2375 35/2375 0/0 INET: 12/531 56/1937 57/1705 INET6: 0/0 0/0 0/0 OTHER: 0/0 0/0 0/0 forks: 0
cvirt
This contains the uptime bias, utsname settings (sys, node, rel, vers, machine, domain), the number of threads, thread stats (running, uninterruptible, on hold), the number of load updates, the load averages (1,5,15) and the number of forks
/proc/virtual/<id>/cvirt BiasUptime: 49.73 SysName: Linux NodeName: XXXX.test.org Release: 2.6.11-rc5 Version: #12 Sun Feb 27 01:07:29 CET 2005 Machine: i686 DomainName: nr_threads: 16 nr_running: 0 nr_unintr: 0 nr_onhold: 0 load_updates: 14585 loadavg: 0.00 0.00 0.00 total_forks: 272
limit
Limit columns are: current (1), max observed (2), limit (3) and number of hits (4)
Limit rows are: processes, virtual memory, locked memory, resident set size, anonymous memory, number of files, filedescriptors, locks, sockets, message queues, and shared memory
/proc/virtual/<id>/limit PROC: 16 17 -1 0 VM: 14440 15331 -1 0 VML: 0 0 -1 0 RSS: 5478 5847 -1 0 ANON: 1516 1516 -1 0 FILES: 140 155 -1 0 OFD: 122 122 -1 0 LOCKS: 1 3 -1 0 SOCK: 9 9 -1 0 MSGQ: 0 0 -1 0 SHM: 0 0 -1 0
Debugging Control
This complete directory seems not to be present by default. Possibly there is a compile- or a runtime-switch to enable debugging.
/proc/sys/vserver .../debug_switch .../debug_xid .../debug_cvirt .../debug_limit .../debug_dlim .../debug_nid .../debug_net /proc/sys/vserver/debug_switch /proc/sys/vserver/debug_xid /proc/sys/vserver/debug_cvirt /proc/sys/vserver/debug_limit /proc/sys/vserver/debug_dlim /proc/sys/vserver/debug_nid /proc/sys/vserver/debug_net
If the directory exist you should be able to create these files by issuing commands like:
echo 255 >/proc/sys/vserver/debug_switch
The bigger problem is to find out which values are useful, see Debugging for details.
Please note: some samples are simply copied from the old wiki at http://oldwiki.linux-vserver.org/HowTo+Read+ProcFS, some other are captured from an Athlon AMD X2 system. They do not necessarily fit together.