Re: Linux::Smaps

2011-04-03 Thread Ævar Arnfjörð Bjarmason
On Tue, Mar 29, 2011 at 18:52, Torsten Förtsch wrote: > Meanwhile Ævar uploaded his own quite specialized smaps parser > (Linux::Smaps::Tiny) to CPAN. Here is what I get in comparison: > > perl -Ilib -MLinux::Smaps -MLinux::Smaps::Tiny \ >     -MBenchmark=:all,:hireswallclock -

Linux::Smaps

2011-03-29 Thread Torsten Förtsch
Hi, after having been told by Ævar that Linux::Smaps is really slow I tuned it a bit. Here is what I get. "new" is version 0.07, "old" is 0.06: perl -MBenchmark=:all,:hireswallclock -MData::Dumper -e ' sub tm { my ($title)=@_; if( my $pid=open my $fh, "-|

Re: [mp2] Apache2::SizeLimit should be using $s->rss, not $s->size for Linux::Smaps

2011-02-09 Thread Fred Moyer
che/SizeLimit/Core.pm > === > --- lib/Apache/SizeLimit/Core.pm        (revision 905815) > +++ lib/Apache/SizeLimit/Core.pm        (working copy) > @@ -175,7 +175,7 @@ >     return $class->_linux_size_check() unless $USE_SMAPS; > >     my $s = Linux:

Re: [mp2] Apache2::SizeLimit should be using $s->rss, not $s->size for Linux::Smaps

2011-02-09 Thread Max Kanat-Alexander
che/SizeLimit/Core.pm(working copy) @@ -175,7 +175,7 @@ return $class->_linux_size_check() unless $USE_SMAPS; my $s = Linux::Smaps->new($$)->all; -return ($s->size, $s->shared_clean + $s->shared_dirty); +return ($s->rss, $s->shared_clean +

Re: [mp2] Apache2::SizeLimit should be using $s->rss, not $s->size for Linux::Smaps

2011-02-09 Thread Max Kanat-Alexander
So, I just recently installed the very latest release of SizeLimit, and this is still a problem. SizeLimit **definitely** returns the wrong unshared size for processes on any modern Linux system. -Max On 02/03/2010 12:05 PM, Max Kanat-Alexander wrote: > On 02/03/2010 04:57 AM, Tor

Re: [mp2] Apache2::SizeLimit should be using $s->rss, not $s->size for Linux::Smaps

2010-02-03 Thread Max Kanat-Alexander
On 02/03/2010 04:57 AM, Torsten Förtsch wrote: > Well, I tend to disagree. (Fred, Adam please read on.) Okay. Have you looked at the actual output of test.cgi? Here's an example of these values just on my local machine, for my bash interpreter: [mka...@es-compy ~]$ cat /proc/self

Re: [mp2] Apache2::SizeLimit should be using $s->rss, not $s->size for Linux::Smaps

2010-02-03 Thread Torsten Förtsch
>size on the Linux::Smaps object, when instead it should be returning > $s->rss as the process size. > Well, I tend to disagree. (Fred, Adam please read on.) The /proc/PID/statm based check returns the fields 0 and 2. According to the following table from KERNEL/Documentation/filesys

Re: [mp2] Apache2::SizeLimit should be using $s->rss, not $s->size for Linux::Smaps

2010-02-02 Thread Fred Moyer
PM, Max Kanat-Alexander wrote: >        All of my processes kept exiting with a report that they had a 300M > unshared size, which was clearly untrue, even from looking at top. After > some investigation, I discovered that Apache2::SizeLimit was calling > $s->size on the Linux::Sma

[mp2] Apache2::SizeLimit should be using $s->rss, not $s->size for Linux::Smaps

2010-02-02 Thread Max Kanat-Alexander
All of my processes kept exiting with a report that they had a 300M unshared size, which was clearly untrue, even from looking at top. After some investigation, I discovered that Apache2::SizeLimit was calling $s->size on the Linux::Smaps object, when instead it should be returning $s-&

Re: Linux::Smaps on RHEL

2009-07-22 Thread Torsten Foertsch
On Wed 22 Jul 2009, Jonathan Swartz wrote: > I'm running into the problem using Linux::Smaps on RHEL with an > Apache   server on port 80. Namely, that the httpd child doesn't have > permissions to look at the smaps file. > >       Linux::Smaps: Cannot open /proc/20074

Re: Linux::Smaps on RHEL

2009-07-22 Thread hans
g the setuid bit to force the auditing process to run under the user owning the maps. Good luck Hans - "Jonathan Swartz" escribió: > I'm running into the problem using Linux::Smaps on RHEL with an Apachee > > server on port 80. Namely, that the httpd child doesn'

Linux::Smaps on RHEL

2009-07-21 Thread Jonathan Swartz
I'm running into the problem using Linux::Smaps on RHEL with an Apache server on port 80. Namely, that the httpd child doesn't have permissions to look at the smaps file. Linux::Smaps: Cannot open /proc/20074/smaps: Permission denied or Linux::Smaps: Cannot open /proc/

Re: Linux::Smaps kernel/perlio dependencies

2008-06-03 Thread André Warnier
Torsten, many thanks for the time taken for the explanation. I still understand only slightly less than 50% of it, but then I don't really need to understand more either. I am just very glad and thankful that there are people such as you who apparently do understand it, upon which we can rel

Re: Linux::Smaps kernel/perlio dependencies

2008-06-03 Thread Torsten Foertsch
On Tue 03 Jun 2008, André Warnier wrote: > I find it interesting that the answers are all different on system (1), > but all the same on system (2). > I don't have a clue as to what it means, or what it does to my systems, > but I trust you do. Just to enlighten you. Originally linux on x86 used t

Re: Linux::Smaps kernel/perlio dependencies

2008-06-03 Thread André Warnier
Torsten Foertsch wrote: On Tue 03 Jun 2008, Torsten Foertsch wrote: [...] Thanks to all so far. But could you please try that command for PERLIO=perlio and perhaps PERLIO=unix too? Here you go. I find it interesting that the answers are all different on system (1), but all the same on sy

Re: Linux::Smaps kernel/perlio dependencies

2008-06-03 Thread Michael Peters
Torsten Foertsch wrote: > It should print 2 almost identical lines. If there are more please report. Perl 5.8.8 and Linux 2.6.20 only prints 2. -- Michael Peters Plus Three, LP

Re: Linux::Smaps kernel/perlio dependencies

2008-06-03 Thread Torsten Foertsch
On Tue 03 Jun 2008, Torsten Foertsch wrote: > Could you please run the following command on various combinations of linux > kernel and perlio? > > PERLIO="stdio" perl -pe 'BEGIN {my $smaps="/proc/$$/smaps"; >   open STDIN, "<", $smaps or die "$!\n"; system "cat -n $smaps"} >   $_="$.\t$_"' | grep v

Re: Linux::Smaps kernel/perlio dependencies

2008-06-03 Thread André Warnier
x27; cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP THREADS_HAVE_PIDS USE_64_BIT_ALL USE_

Linux::Smaps kernel/perlio dependencies

2008-06-03 Thread Torsten Foertsch
Hi, I have recently got a bug report about Linux::Smaps. The poster said it'd report 2 [vdso] areas and that it can be cured if /proc/self/smaps is opened with '<:stdio'. Later on he also found the behavior depends on the kernel version, 2.6.25.3 shows 2 vdsos 2.6.23.1-21 only o

Re: Fwd: CPAN Upload: O/OP/OPI/Linux-Smaps-0.04.tar.gz

2007-10-08 Thread Max Kanat-Alexander
On Mon, 8 Oct 2007 17:52:46 +0200 Torsten Foertsch <[EMAIL PROTECTED]> wrote: > this version mainly disables the portable warning. Further the > constructor now throws an exception if the smaps file cannot be read. > Also a short note in the docs about swapped pages and mlockall(2) was > added.

Fwd: CPAN Upload: O/OP/OPI/Linux-Smaps-0.04.tar.gz

2007-10-08 Thread Torsten Foertsch
Linux-Smaps-0.04.tar.gz has entered CPAN as file: $CPAN/authors/id/O/OP/OPI/Linux-Smaps-0.04.tar.gz size: 22163 bytes md5: 20faeb2df7ccbd2931222e97e7bc7e0e ... --- pgpj7Q458jVjF.pgp Description: PGP signature

Re: Apache2::SizeLimit & Linux::Smaps on x86_64

2007-10-08 Thread Max Kanat-Alexander
On Mon, 8 Oct 2007 01:38:23 -0700 Max Kanat-Alexander <[EMAIL PROTECTED]> wrote: > Okay, it's not SELinux. For some reason, smaps is set > root:root 400 for all processes, even though /proc/$$/ is properly > owned by the "apache" user. I'll have to investigate how to change > that, I suppose.

Re: Apache2::SizeLimit & Linux::Smaps on x86_64

2007-10-08 Thread Max Kanat-Alexander
On Mon, 8 Oct 2007 01:35:02 -0700 Max Kanat-Alexander <[EMAIL PROTECTED]> wrote: > I suspect SELinux, at the moment. Okay, it's not SELinux. For some reason, smaps is set root:root 400 for all processes, even though /proc/$$/ is properly owned by the "apache" user. I'll have to inves

Re: Apache2::SizeLimit & Linux::Smaps on x86_64

2007-10-08 Thread Max Kanat-Alexander
On Mon, 8 Oct 2007 09:45:58 +0200 Torsten Foertsch <[EMAIL PROTECTED]> wrote: > Is it possible that your httpd cannot access /proc/self/smaps? Yes, that seems to be the problem. It can stat it, but not read it. In order to find this out, I had to make Linux::Smaps::upda

Re: Apache2::SizeLimit & Linux::Smaps on x86_64

2007-10-08 Thread Torsten Foertsch
b64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/Apache2/SizeLi >mit.pm line 113. Is it possible that your httpd cannot access /proc/self/smaps? Maybe it's chrooted lacking the /proc filesystem in the new root? Something like this? Linux::Smaps->new($pid) can fail only if a $pid&

Re: Apache2::SizeLimit & Linux::Smaps on x86_64

2007-10-07 Thread Max Kanat-Alexander
On Mon, 8 Oct 2007 08:26:51 +0200 Torsten Foertsch <[EMAIL PROTECTED]> wrote: > In your modperl environment "use warnings FATAL=>qw/all/" is active. > Hence, the portable warning is turned into a portable error. That's > all. No, because it still doesn't work, even with the patch. I don't

Re: Apache2::SizeLimit & Linux::Smaps on x86_64

2007-10-07 Thread Torsten Foertsch
On Sunday 07 October 2007 23:29, Max Kanat-Alexander wrote: > So it looks like it works fine for what smem is doing, but it > somehow doesn't work right for Apache2::SizeLimit. In your modperl environment "use warnings FATAL=>qw/all/" is active. Hence, the portable warning is turned into

Re: Apache2::SizeLimit & Linux::Smaps on x86_64

2007-10-07 Thread Max Kanat-Alexander
On Sun, 7 Oct 2007 14:29:30 -0700 Max Kanat-Alexander <[EMAIL PROTECTED]> wrote: > Hrm, okay. I've attached the output of your smem script, > [snip] And in case it helps, here's the gzipped output of smaps for the same process. -Max -- http://www.everythingsolved.com/ Compe

Re: Apache2::SizeLimit & Linux::Smaps on x86_64

2007-10-07 Thread Max Kanat-Alexander
On Sun, 07 Oct 2007 21:14:23 +0200 Clinton Gormley <[EMAIL PROTECTED]> wrote: > Max - try using this script to see where your memory is being used: > > http://www.contrib.andrew.cmu.edu/~bmaurer/memory/smem.pl Hrm, okay. I've attached the output of your smem script, which curiously seemed

Re: Apache2::SizeLimit & Linux::Smaps on x86_64

2007-10-07 Thread Clinton Gormley
> Yes, I think so. The point is 64bit integers are not portable to 32bit perls. > Hence, even on a 64bit system with warnings enabled a non-portable warning is > issued: Ahhh I get it - so it isn't warning you that there is a problem using this on your system, just that the same input on a 32 b

Re: Apache2::SizeLimit & Linux::Smaps on x86_64

2007-10-07 Thread Torsten Foertsch
On Sunday 07 October 2007 15:31, Clinton Gormley wrote: > > -no warnings qw(uninitialized); > > +no warnings qw(uninitialized portable); > > This patch certaily removes the warnings, and all of the tests pass. But > does that mean that the module works correctly? Yes, I think so. The point is 64bi

Re: Apache2::SizeLimit & Linux::Smaps on x86_64

2007-10-07 Thread Clinton Gormley
(Resent with smaller attachment - previous version refused because too large) > Linux::Smaps simply analyzes /proc/$PID/smaps. It was initially written on a > 32bit system. Looking at your bug report I assume the hex() function doesn't > work for 64bit hex values. Can you show us

Re: Apache2::SizeLimit & Linux::Smaps on x86_64

2007-10-07 Thread Torsten Foertsch
On Saturday 06 October 2007 03:52, Max Kanat-Alexander wrote: > I have an x86_64 machine running RHEL5 but with the mod_perl > 2.0.3 from Fedora 7. > > Without Linux::Smaps installed, Apache2::SizeLimit thinks my > processes are taking up 300MB and terminates them

Re: Apache2::SizeLimit & Linux::Smaps on x86_64

2007-10-06 Thread Perrin Harkins
On 10/6/07, Max Kanat-Alexander <[EMAIL PROTECTED]> wrote: > Yes, they really are using that much but nearly all of it is > shared via copy-on-write, as far as I can tell. SizeLimit is supposed > to be able to detect that situation on modern kernels if you have > Linu

Re: Apache2::SizeLimit & Linux::Smaps on x86_64

2007-10-05 Thread Max Kanat-Alexander
a copy-on-write? Yes, they really are using that much but nearly all of it is shared via copy-on-write, as far as I can tell. SizeLimit is supposed to be able to detect that situation on modern kernels if you have Linux::Smaps installed, according to its docs. (I have only MAX_UNSHARE

Re: Apache2::SizeLimit & Linux::Smaps on x86_64

2007-10-05 Thread Perrin Harkins
On 10/5/07, Max Kanat-Alexander <[EMAIL PROTECTED]> wrote: > I have an x86_64 machine running RHEL5 but with the mod_perl > 2.0.3 from Fedora 7. > > Without Linux::Smaps installed, Apache2::SizeLimit thinks my > processes are taking up 300MB and terminates

Apache2::SizeLimit & Linux::Smaps on x86_64

2007-10-05 Thread Max Kanat-Alexander
I have an x86_64 machine running RHEL5 but with the mod_perl 2.0.3 from Fedora 7. Without Linux::Smaps installed, Apache2::SizeLimit thinks my processes are taking up 300MB and terminates them after every hit. ("top" thinks so too, but "free -m" quickly

Re: [PATCH] Apache2::SizeLimit + Linux::Smaps

2005-09-16 Thread Torsten Foertsch
On Wednesday 07 September 2005 04:25, Philip M. Gollucci wrote: > Torsten Foertsch wrote: > > Hi, > > > > this patch introduces $Apache2::SizeLimit::USE_SMAPS which is 1 by > > default. If /proc/PID/smaps are not available Apache::SizeLimit resets it > > to 0 itself. It can be reset by the user if

Re: [PATCH] Apache2::SizeLimit + Linux::Smaps

2005-09-06 Thread Philip M. Gollucci
Torsten Foertsch wrote: Hi, this patch introduces $Apache2::SizeLimit::USE_SMAPS which is 1 by default. If /proc/PID/smaps are not available Apache::SizeLimit resets it to 0 itself. It can be reset by the user if he prefers using /proc/PID/statm before the first size check. If $USE_SMAPS is

Re: [PATCH] Apache2::SizeLimit + Linux::Smaps

2005-09-05 Thread Philip M. Gollucci
Torsten Foertsch wrote: Hi, this patch introduces $Apache2::SizeLimit::USE_SMAPS which is 1 by default. If /proc/PID/smaps are not available Apache::SizeLimit resets it to 0 itself. It can be reset by the user if he prefers using /proc/PID/statm before the first size check. If $USE_SMAPS is

[PATCH] Apache2::SizeLimit + Linux::Smaps

2005-09-05 Thread Torsten Foertsch
= 0; our $MAX_UNSHARED_SIZE = 0; +our $USE_SMAPS = 1; our ($HOW_BIG_IS_IT, $START_TIME); @@ -56,7 +57,12 @@ } elsif (LINUX) { -$HOW_BIG_IS_IT = \&linux_size_check; +if ( eval { require Linux::Smaps } and Linux::Smaps->new($$) ) { + $HOW_BI