Difference between revisions of "ProcFS"
From Linux-VServer
(→Context specific information) |
(+cat) |
||
Line 235: | Line 235: | ||
# echo 255 >/proc/sys/vserver/debug_switch | # echo 255 >/proc/sys/vserver/debug_switch | ||
</pre> | </pre> | ||
+ | |||
+ | [[Category:Theory]] |
Latest revision as of 20:26, 21 October 2011
Information about currently running contexts can be found inside the /proc/virtual and /proc/virtnet directory. All information provided there is read-only, i.e. it cannot be used to change any values like other entries in /proc may do. Because it usually is world-readable you do not have to gain root access to look at this information.
Beside this information you can also control various debugging related settings using /proc/sys/vserver/debug if you have enabled debugging in your kernel configuration.
Note: The examples and descriptions are based on the 2.1.1 kernel patch. If you're using a previous version some information may not be present and/or available with a slightly different name.
Contents |
[edit] Generic information
Currently there is only one file with generic information about the vserver host, that is /proc/virtual/info:
[edit] info
# cat /proc/virtual/info VCIVersion: 0002:0002 VCISyscall: 236 VCIKernel: 03000016
- VCIVersion
- Current API version of the kernel
- VCISyscall
- Syscall number of the vserver syscall
- VCIKernel
- Bitmask of the CONFIG_VSERVER kernel configuration options
Beside VCIKernel the information provided in this file can also be gathered using the vserver-info utility from util-vserver.
# 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
[edit] Context specific information
[edit] info
# cat /proc/virtual/<xid>/info ID: 1001 Info: 83c37000 Init: 0
- ID
- Context ID
- Info
- Memory location of the vx_info structure
- Init
- Real PID of the init process
[edit] status
This file contains general status information.
# cat /proc/virtual/<xid>/status UseCnt: 38 Tasks: 16 Flags: 0000000002020010 BCaps: 00000000344c04ff CCaps: 0000000000000101
- UseCnt
- References to the vx_info struct
- Tasks
- Number of processes (tasks) inside the context
- Flags
- Capabilities and Flags
- BCaps
- Capabilities and Flags
- CCaps
- Capabilities and Flags
[edit] sched
This file contains information about the CPU Scheduler.
# cat /proc/virtual/<xid>/sched FillRate: 1,1 Interval: 4,8 TokensMin: 15 TokensMax: 125 PrioBias: 0 VaVaVoom: 0 cpu 0: 0 0 0 0 0 R- 62 15 125 1/4 1/8
- FillRate
- Number of tokens filled into the bucket at each interval
- Interval
- Number of jiffies between each fill interval
- TokensMin
- Minimum number of tokens to be scheduled
- TokensMax
- Maximum number of tokens in the bucket
- PrioBias
- Priority bias
- VaVaVoom
- The calculated priority bonus a guest gets
- cpu X
- Ticks spent in user-space
- Ticks spent in kernel-space
- Ticks spent on hold
- Token time ??
- Idle time ??
- On hold (H) or running (R)
- Uses IDLE time (I) or not (-)
- Current number of tokens
- Minimum number of tokens to be scheduled
- Maximum number of tokens in the bucket
- Minimum number of tokens to be scheduled (IDLE time setting)
- Maximum number of tokens in the bucket (IDLE time setting)
[edit] cacct
This file contains information about Context Accounting, including socket accounting and slab allocator accounting.
# cat /proc/virtual/<xid>/cacct Type recv #/bytes send #/bytes fail #/bytes UNSPEC: 0/0 0/0 0/0 UNIX: 0/0 0/0 0/0 INET: 0/0 0/0 0/0 INET6: 0/0 0/0 0/0 PACKET: 0/0 0/0 0/0 OTHER: 0/0 0/0 0/0 slab: 0 0 4294965416 0 page[0]: 0 0 0 0 0 0 0 0 page[1]: 0 0 0 0 0 0 0 0 page[2]: 0 0 0 0 0 0 0 0 page[3]: 0 0 0 0 0 0 0 0 page[4]: 0 0 0 0 0 0 0 0
[edit] cvirt
This file contains information about virtualized data, including context uptime bias, utsname settings, thread information and load average. Note: some fields are moved in nsproxy file with vs2.3.x.
# cat /proc/virtual/<xid>/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
- BiasUptime
- Context uptime bias (System uptime - BiasUptime = Context uptime)
- SysName
- Kernel name
- NodeName
- Network node hostname
- Release
- Kernel release
- Version
- Kernel version
- Machine
- Machine hardware name
- DomainName
- Network node domainname
- nr_threads
- Total number of threads
- nr_running
- Number of running threads
- nr_unintr
- Number of uninterruptible threads
- nr_onhold
- Number of threads on hold
- load_updates
- Total number of load average updates
- loadavg
- Number of jobs in the run queue averaged over 1, 5, and 15 minutes
- total_forks
- Total number of forks
[edit] nsproxy
Vs 2.3.x (experimental) only.
NSProxy: ffff81000460d338 [ffff81007cca9bc0,ffff8100378d5800,ffff8100378e7600] Namespace: ffff81007cca9bc0 [#2] RootPath: / SysName: Linux NodeName: lenny-amd64 Release: 2.6.26-1-vserver-amd64 Version: #1 SMP Sat Jan 10 19:46:42 UTC 2009 Machine: x86_64 DomainName: (none) SEMS: 250 32000 32 128 0 MSG: 8192 16384 286 SHM: 33554432 2097152 4096 0
[edit] limit
This file contains information about Resource Limits, including Context Accounting (i.e these do not appear in cacct).
# cat /proc/virtual/<xid>/limit Limit current min/max soft/hard hits PROC: 2 2/ 2 -1/ -1 0 VM: 4024 4024/ 4024 -1/ -1 0 VML: 0 0/ 0 -1/ -1 0 RSS: 50 50/ 50 -1/ -1 0 ANON: 33 33/ 33 -1/ -1 0 FILES: 19 19/ 19 -1/ -1 0 OFD: 5 5/ 5 -1/ -1 0 LOCKS: 0 0/ 0 -1/ -1 0 SOCK: 2 2/ 2 -1/ -1 0 MSGQ: 0 0/ 0 -1/ -1 0 SHM: 0 0/ 0 -1/ -1 0 SEMA: 0 0/ 0 -1/ -1 0 SEMS: 0 0/ 0 -1/ -1 0 DENT: 2315 2315/ 2315 -1/ -1 0
- Limit
- Limit name/identifier
- current
- Current value
- min
- Minimum value since the last reset
- max
- Maximum value since the last reset
- soft
- Soft limit
- hard
- hard limit
- hits
- Total amount of current reaching hard
[edit] Debugging Control
The /proc/sys/vserver/debug directory is only present if you have enabled CONFIG_VSERVER_DEBUG during kernel compilation.
To enable debugging you can use a command similar to the following to enable debugging. Please see Kernel Debugging for more information.
# echo 255 >/proc/sys/vserver/debug_switch