rusage. Information on resources used

This field is a hash containing information on server's resources currently used by system for processing your Parser-script.

Some systems cannot return complete range of values listed here (WinNT/Win2000/WinXP can return all values, while Win98 can return only tv_sec and tv_usec).

Key
Unit
Value description
How to reduce?
utime
second
Pure time, i.e. that used by current process (does not include time used by other tasks)
Simplify data manipulation within Parser (improve algorithm, hand some actions over to SQL-server)
stime
second
Time used by system to read your files, directories, and libraries
Decrease number and size of files needed for script's work; do not use modules which are not needed to process current document
maxrss
block
Memory used by process
Decrease number of loaded useless data.
Find and fix all "select *" by specifying only the fields you will really need. Do not load unnecessary data from SQL-server, filter out as much as you can by means of SQL-server itself.


Exact system time. Allows evaluating time used for awaiting response from SQL-, HTTP-, SMTP-servers.

How much time passed since Epoch…

Simplify SQL queries. If you use MySQL, use EXPLAIN; for Oracle: EXPLAIN PLAN (see your server documentation); for other SQL-servers: see relevant documentation.
tv_sec
second
…whole seconds;

tv_usec
millisecond
(10E-6)
…milliseconds
passed (millionths of seconds in addition to whole seconds)



Recommended way of analysing
At the end of your script place construction…

^rusage[total]

…to call this method:

@rusage[comment][v;now;prefix;message;line;usec]
$v[$status:rusage]
$now[^
date::now[]]
$usec(^v.tv_usec.
double[])
$prefix[[^now.
sql-string[].^usec.format[%06.0f]] $env:REMOTE_ADDR: $comment]
$message[$v.utime $v.stime 
$request:uri]
$line[$prefix $message 
^#0A]
^line.
save[append;/rusage.log]
$
result[]

…and analyze the log.

For a more precise analysis, surround the block to be checked with calls…

^rusage[before XXX]
^rusage[after XXX]

Note: it is not recommended to store log file within web-space.

WinNT/2K/XP
Under these OSes, certain extra values are available:

Key
Unit
Value description
How to reduce?
ReadOperationCount
ReadTransferCount

items
bytes
Number of operations on reading from disk and total number of bytes read
Decrease number and size of files needed for the process; do not use modules not needed for processing current document.

Use SQL-server rather than files.
WriteOperationCount
WriteTransferCount

items
bytes
Number of operations on writing to disk and total number of bytes written


OtherOperationCount
OtherTransferCount


items
bytes
Number of other operations with disk (apart from read/write) and total number of bytes transferred


PeakPagefileUsage
QuotaPeakNonPagedPoolUsage
QuotaPeakPagedPoolUsage

bytes
Memory-paging file size limit
see above comment to maxrss



Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 04.09.2008