Страница 1 из 1

[PERL] снимать нагрузку для apache perl

Добавлено: 2008-05-16 19:19:48
ProFTP
как снимать нагрузку с ЦП, load Average, processes для каждого виртуального хоста apache?? пишу на perl

может есть модуль?

Re: снимать нагрузку для apache perl

Добавлено: 2008-05-16 20:07:38
ProFTP
вот нашел но тут не для каждого

http://search.cpan.org/~mjh/GTop-0.16/GTop.pod




GTop::ProcUid

my $proc_uid = $gtop->proc_uid($pid);

flags

my $flags = $proc_uid->flags;

uid

my $uid = $proc_uid->uid;

euid

my $euid = $proc_uid->euid;

gid

my $gid = $proc_uid->gid;

egid

my $egid = $proc_uid->egid;

pid


можно снять все остальное на основе uid?

Re: снимать нагрузку для apache perl

Добавлено: 2008-05-17 7:59:18
zg
можно, если на каждый виртуальный хост у тебя свой процесс апача

Re: снимать нагрузку для apache perl

Добавлено: 2008-05-17 8:39:21
ProFTP
zg писал(а):можно, если на каждый виртуальный хост у тебя свой процесс апача
всмысле?
от пользователя конкретного скрипты должны работать?

вот показало что я могу снимать вот это

Код: Выделить всё

GTop::ProcUid
GTop::ProcMem
и записывать с базу.. :roll:

то есть процессы которые генеряться от конкретного юзера...? только load Average я не видел чтобы от юзера...

Re: [PERL] снимать нагрузку для apache perl

Добавлено: 2008-06-02 0:38:00
serge
Чето не ставится GTop. У когонить получилось поставить его?

Код: Выделить всё

# cpan -i GTop
....
GTop.c: In function 'XS_GTop__Loadavg_loadavg':
GTop.c:1529: error: 'GTop__Loadavg' undeclared (first use in this function)
GTop.c:1529: error: expected ';' before 'self'
GTop.xs:573: warning: ISO C90 forbids mixed declarations and code
GTop.c:1538: error: 'self' undeclared (first use in this function)
GTop.c: In function 'XS_GTop__ProcState_cmd':
GTop.c:1566: error: 'GTop__ProcState' undeclared (first use in this function)
GTop.c:1566: error: expected ';' before 'state'
GTop.c:1567: warning: ISO C90 forbids mixed declarations and code
GTop.c:1572: error: 'state' undeclared (first use in this function)
GTop.c: In function 'XS_GTop__ProcState_state':
GTop.c:1591: error: 'GTop__ProcState' undeclared (first use in this function)
GTop.c:1591: error: expected ';' before 'state'
GTop.c:1592: warning: ISO C90 forbids mixed declarations and code
GTop.c:1597: error: 'state' undeclared (first use in this function)
GTop.c: In function 'XS_GTop__ProcState_uid':
GTop.c:1616: error: 'GTop__ProcState' undeclared (first use in this function)
GTop.c:1616: error: expected ';' before 'state'
GTop.c:1617: warning: ISO C90 forbids mixed declarations and code
GTop.c:1622: error: 'state' undeclared (first use in this function)
GTop.c: In function 'XS_GTop__ProcState_gid':
GTop.c:1641: error: 'GTop__ProcState' undeclared (first use in this function)
GTop.c:1641: error: expected ';' before 'state'
GTop.c:1642: warning: ISO C90 forbids mixed declarations and code
GTop.c:1647: error: 'state' undeclared (first use in this function)
*** Error code 1

Stop in /root/.cpan/build/GTop-0.16.
  /usr/bin/make  -- NOT OK
Running make test
  Can't test without successful make
Running make install
  make had returned bad status, install seems impossible

Re: [PERL] снимать нагрузку для apache perl

Добавлено: 2008-06-02 0:38:53
serge
И еще вот что накопал http://search.cpan.org/~mjh/Apache-VMon ... Monitor.pm
Может кому пригодится.