mod_performance – список параметров

Path to daemon socket created on apache start

Name: PerformanceSocket
Configuration file location: Global
Default value: logs/perfsocket
Example: PerformanceSocket /etc/httpd/logs/perf.sock

On|Off monitoring for virtualhosts

Name: PerformanceEnabled
Configuration file location: Global, VirtualHost
Default value: Off
Example: PerformanceEnabled On

Host name filter. Watch only pointed host names

Name: PerformanceHostFilter
Configuration file location: Global, VirtualHost
Default value: Null
Example: PerformanceHostFilter example.host1.com example.host2.com …

URI filter. Regexp for watching only needed requests uri

Name: PerformanceURI
Configuration file location: Global, VirtualHost
Default value: Null
Example: PerformanceURI \.html$

Called script filter. Regexp for watching only needed called scripts.

Name: PerformanceScript
Configuration file location: Global, VirtualHost
Default value: Null
Example: PerformanceScript \.php$

Report page handler. For output all statistics

Name: PerformanceWorkHandler
Configuration file location: Global, VirtualHost
Default value: performance-status
Example: PerformanceWorkHandler performance-status

Report page handler. For output called host statistics

Name: PerformanceUserHandler
Configuration file location: Global, VirtualHost
Default value: user-status
Example: PerformanceUserHandler user-status

Logging type — Log(save info into log file, PerformanceLog, PerformanceLogFormat), SQLite — save info to sqlite database (PerformanceDB, PerformanceHistory), MySQL — save info to MySQL database(PerformanceDbUserName, PerformanceDBPassword, PerformanceDBName, PerformanceDBHost, PerformanceHistory), Postgres — save info to PostgreSQL database(PerformanceDbUserName, PerformanceDBPassword, PerformanceDBName, PerformanceDBHost, PerformanceHistory).

Name: PerformanceLogType
Configuration file location: Global
Default value: SQLite
Example: PerformanceLogType Log

Path to database – SQLite

Name: PerformanceDB
Configuration file location: Global
Default value: logs/perfdb
Example: PerformanceDB /etc/httpd/log/perf.db

DB name for MySQL, PostgreSQL:

Name: PerformanceDbName
Configuration file location: Global
Default value: perf_db
Example: PerformanceDBName perfdb

DB user for MySQL, PostgreSQL for statistic access:

Name: PerformanceDbUserName
Configuration file location: Global
Default value: perf_user
Example: PerformanceDbUserName perf

DB password for MySQL, PostgreSQL for statistic access:

Name: PerformanceDBPassword
Configuration file location: Global
Default value: perf_password
Example: PerformanceDBPassword pass

DB host for MySQL, PostgreSQL for statistic access:

Name: PerformanceDBHost
Configuration file location: Global
Default value: localhost
Example: PerformanceDBHost host1.com

Path to log file for Log mode:

Name: PerformanceLog
Configuration file location: Global, VirtualHost
Default value: Null
Example: PerformanceLog logs/perf.log

Log output format - Log mode. Service variables:

  • %DATE% - request date
  • %HOST% – request for host,
  • %URI% – uri,
  • %SCRIPT% – requested script,
  • %CPU% – cpu usage,
  • %MEM% – memory usage,
  • %EXCTIME% – script execution time,
  • % % – percent sign:
Name: PerformanceLogFormat
Configuration file location: Global
Default value: [%DATE%] from %HOST% (%URI%) script %SCRIPT%: cpu %CPU%, memory %MEM%, execution time %EXCTIME%
Example: PerformanceLogFormat [%DATE%] from %HOST% (%URI%) script %SCRIPT%: cpu %CPU%, memory %MEM%, execution time %EXCTIME%

Days number of statistics storing - SQLite, MySQL, Postgres.

Name: PerformanceHistory
Configuration file location: Global
Default value: 30
Example: PerformanceHistory 10

Allow to ignore redirect-handler. Switch to On if uses mod-rewrite:

Name: PerformanceUseCanonical
Configuration file location: Global
Default value: Off
Example: PerformanceUseCanonical On

Calculation mod of % CPU usage. Solaris | Irix

Name: PerformanceUseCPUTopMode
Configuration file location: Global
Default value: Irix
Example: PerformanceUseCPUTopMode Solaris

Restart watching daemon period

Supported formats: HH:MM:SS or HH-MM-SS (time to restart) or ddddd (seconds interval until daemon restart).

Name: PerformanceCheckDaemonTimeExec
Configuration file location: Global
Default value: NULL
Example: PerformanceCheckDaemonTimeExec 20:00:00

For MySQL only. Fragmentation of base. Supported formats: HH:MM:SS

Name: PerformanceFragmentationTime
Configuration file location: Global
Default value: NULL
Example: PerformanceFragmentationTime 20:00:00

Values

  1. number(in 1/100 seconds),
  2. HARD/SOFT – minimal execution time wich will be stored in database of statistic HARD(not save of less)/SOFT(save with 0 %CPU)
Name: PerformanceMinExecTime
Configuration file location: Global
Default value: NULL
Example: PerformanceMinExecTime 10 SOFT

Same as PerformanceExternalScrip but for cooperation with suphp.

Name: PerformanceExternalScript
Configuration file location: Global, VirtualHost
Default value: NULL
Example: PerformanceExternalScript \.php$

On| Off - logging from module

Name: PerformanceSilentMode
Configuration file location: Global
Default value: On
Example: PerformanceSilentMode Off

Can be PerformanceSocketPermType NUMBER NOPID or PerformanceSocketPermType NUMBER PID. Use apache pid in socket name or not and setup socket rights. Needed for suphp & php-fpm

Name: PerformanceSocketPermType
Configuration file location: Global
Default value: 000 PID
Example: PerformanceSocketPermType 777 NOPID

On|Off - check PID or TID of watching process. For worker should be TID.

Name: PerformanceUseTid
Configuration file location: Global
Default value: Off
Example: PerformanceUseTid On

Log host name. For centralized database:

Name: PerformanceHostId
Configuration file location: Global
Default value: localhost
Example: PerformanceHostId server1

Path to custom reports:

Name: PerformanceCustomReports
Configuration file location: Global
Default value: NULL
Example: PerformanceCustomReports /opt/performance/customrep.tpl

Syntax of custom report in file custom.tpl:

[Report name]
header=Fld 1|Fld 2|Fld 3;
ssql=request in SQLite syntax;
msql=request in MySQL syntax;
psql=request in PostgerSQL syntax;
sort=1,2;

Alias and table fields accordance:

* id :ITEMNUMBER: – item identificator
* dateadd :DATEADD: – date add
* host :FORHOST: – requested host
* uri :REQUESTURI: – URI
* script :CALLEDSCRIPT: – requested script
* cpu :CPUUSAGE: – CPU in %
* memory :MEMUSAGEINPRCT: – memory in %
* exc_time :EXECUTIONTIME: – execution time
* cpu_sec :CPUUSAGEINSEC:
* memory_mb :MEMUSAGEINMB: – memory in Mb
* bytes_read :BYTESREAD:- read bytes
* bytes_write :BYTESWRITE: – write bytes
* hostnm :HOSTNAME: – request was on the server with name …

Filtee fileds:

  • :FILTER: – use web-interface filters
  • :PERIOD: – use web-interface period
  • performance – :TBL: – table alias

Example:

custom.tpl
select count(*) as t1, sum(:CPUUSAGE:)/count(*) as t2, sum(:MEMUSAGEINPRCT:)/count(*) as t3, sum(:BYTESREAD:+:BYTESWRITE:)/count(*) as t4,  :CALLEDSCRIPT:, :FORHOST: from :TBL: where :FILTER: and :PERIOD: group by :CALLEDSCRIPT:,:FORHOST:

Set stage of statistics gathering. LogHook - gathering statistics in logtransaction hook or Filter - gathering in output filter. LogHook - recommended for: mpm-prefork, mpm-itk, and Filter - for mpm-worker, mpm-event.

Name: PerformanceWorkMode
Configuration file location: Global
Default value: LogHook
Example: PerformanceWorkMode Filter