RE: ModPerl 2.0.1 AIX4.3.3 - Make Test Fails to run
Le mercredi 17 août 2005 à 15:59 -0500, ODELL, TODD E (SWBT) a écrit : I'll try shutting other programs down prior to running and see if I can set the timeout higher. I'm a little dubious Is there another way to run this to show more detail of what's going on? Hi, I think that you probably hit the problem described here http://perl.apache.org/docs/2.0/user/troubleshooting/troubleshooting.html#Server_Hanging_at_the_Startup AFAIK, AIX version prior to 5, have no /dev/*random, you should try to i) install PRNGD, see http://www.aet.tu-cottbus.de/personen/jaenicke/postfix_tls/prngd.html ii) Install APR, but do not forget to specify the following configure option --with-egd=/dev/egd-pool iii) try to build apache with the following options properly set : --with-egd=/dev/egd-pool --with-apr=/usr/local/bin/apr-config You may find adding the following option useful --without-berkeley-db By following these steps, and with some patches, I manage to build apr 0.9.7, apache 2.0.54, modperl 2.0.1 with gcc 2.95.3 on aix 4.3.2 Hope this helps. For AIX specific stuff, I mean not modperl related, do not hesitate to drop me an e-mail OFF-LIST Best regards, José
Re: a faster html::template?
1500 record? don't do it: page or use AJAX. Been there. It was horrible. I'd second that..1500 seems too high for human consumption. Anyway, for such large datasets you can try going XML/XSLT way. XSLT transforms are VERY fast (use LibXSLT) - downside being XSL is a super verbose and hard to maintain language.. You can even experiment with client side XSL transformation since that both Firefox and IE support it. - Praveen __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Crontab entry from perl
I want to schedule a perl script in crontab using a CGI script. If i try to append in the file ie /var/spool/cron/username then apache user does not have rights to modify this. If i give root rights to apache then it could be very harmful . how can i make entry into cron from script. You could have the CGI write out a file in /tmp or other and then have a permenant root run cron or trivial dameon poll this file and add to a users crontab based on the contents. I don't see what this has to do with modperl though :) or roll your own cron: http://search.cpan.org/~roland/Schedule-Cron-0.9/Cron.pm --- Badai Aqrandista Cheepy (?) _ SEEK: Over 80,000 jobs across all industries at Australia's #1 job site. http://ninemsn.seek.com.au?hotmail
[PATCH] Apache2::SizeLimit + Linux::Smaps
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 1 /proc/PID/smaps are used. Otherwise the old /proc/PID/statm is used. Torsten --- mod_perl-2.0.1/lib/Apache2/SizeLimit.pm 2005-04-26 20:58:44.0 +0200 +++ mod_perl-2.0.1.new/lib/Apache2/SizeLimit.pm 2005-09-05 18:53:57.440450931 +0200 @@ -41,6 +41,7 @@ our $MAX_PROCESS_SIZE = 0; our $MIN_SHARE_SIZE = 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_BIG_IS_IT = \linux_smaps_size_check_first_time; + } else { + $USE_SMAPS = 0; + $HOW_BIG_IS_IT = \linux_size_check; + } } elsif (BSD_LIKE) { @@ -85,6 +91,20 @@ } } +sub linux_smaps_size_check_first_time { +if( $USE_SMAPS ) { +$HOW_BIG_IS_IT=\linux_smaps_size_check; +} else { +$HOW_BIG_IS_IT=\linux_size_check; +} +goto $HOW_BIG_IS_IT; +} + +sub linux_smaps_size_check { +my $s=Linux::Smaps-new($$)-all; +return ($s-size, $s-shared_clean+$s-shared_dirty); +} + # return process size (in KB) sub linux_size_check { my($size, $resident, $share) = (0, 0, 0); --- mod_perl-2.0.1/docs/api/Apache2/SizeLimit.pod 2005-04-26 20:58:54.0 +0200 +++ mod_perl-2.0.1.new/docs/api/Apache2/SizeLimit.pod 2005-09-05 19:52:17.424836878 +0200 @@ -2,8 +2,6 @@ Apache2::SizeLimit - Because size does matter. - - =head1 Synopsis This module allows you to kill off Apache httpd processes if they grow @@ -61,7 +59,7 @@ This module is highly platform dependent, please read the LCaveats|/Caveats section. It also does not work Lunder threaded -MPMs|/Supported_MPMs. +MPMs|/Supported MPMs. This module was written in response to questions on the mod_perl mailing list on how to tell the httpd process to exit if it gets too @@ -138,6 +136,87 @@ seems to be fast enough on modern systems. If you are worried about performance, try setting the CCHECK_EVERY_N_REQUESTS option. +Since linux 2.6 F/proc/self/statm does not report the amount of +memory shared by the copy-on-write mechanism as shared memory. Hence +decisions made on the basis of CMAX_UNSHARED_SIZE or CMIN_SHARE_SIZE +are inherently wrong. + +To correct the situation there is a patch to the linux kernel that adds a +F/proc/self/smaps entry for each process. At the time of this writing +the patch is included in the mm-tree (linux-2.6.13-rc4-mm1) and is expected +to make it into the vanilla kernel in the near future. + +F/proc/self/smaps reports various sizes for each memory segment of a +process and allows to count the amount of shared memory correctly. + +If CApache2::SizeLimit detects a kernel that supports F/proc/self/smaps +and if the CLinux::Smaps module is installed it will use them instead of +F/proc/self/statm. You can prevent CApache2::SizeLimit from using +F/proc/self/smaps and turn on the old behaviour by setting +C$Apache2::SizeLimit::USE_SMAPS to 0 before the first check. + +CApache2::SizeLimit also resets C$Apache2::SizeLimit::USE_SMAPS to 0 +if it somehow decides not to use F/proc/self/smaps. Thus, you can +check it to determine what is actually used. + +NOTE: Reading F/proc/self/smaps is expensive compared to +F/proc/self/statm. It must look at each page table entry of a process. +Further, on multiprocessor systems the access is synchronized with +spinlocks. Hence, you are encouraged to set the CCHECK_EVERY_N_REQUESTS +option. + +The following example shows the effect of copy-on-write: + + Perl + require Apache2::SizeLimit; + package X; + use strict; + use Apache2::RequestRec (); + use Apache2::RequestIO (); + use Apache2::Const -compile=qw(OK); + + my $x=ax(1024*1024); + + sub handler { +my $r=shift; +my ($size, $shared)=$Apache2::SizeLimit::HOW_BIG_IS_IT-(); +$x=~tr/a/b/; +my ($size2, $shared2)=$Apache2::SizeLimit::HOW_BIG_IS_IT-(); +$r-content_type('text/plain'); +$r-print(1: size=$size shared=$shared\n); +$r-print(2: size=$size2 shared=$shared2\n); +return Apache2::Const::OK; + } + /Perl + + Location /X + SetHandler modperl + PerlResponseHandler X + /Location + +The parent apache allocates a megabyte for the string in C$x. The +Ctr-command then overwrites all a with b if the handler is +called with an argument. This write is done in place, thus, the +process size doesn't change. Only C$x is not shared anymore by +means of copy-on-write between the parent and the child. + +If F/proc/self/smaps is available curl shows: + + [EMAIL PROTECTED]:~/work/mp2 curl http://localhost:8181/X + 1: size=13452 shared=7456 + 2: size=13452 shared=6432 + +Shared memory has lost
Re: [PATCH] Apache2::SizeLimit + Linux::Smaps
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 1 /proc/PID/smaps are used. Otherwise the old /proc/PID/statm is used. +1 Any objections ? --- END What doesn't kill us can only make us stronger. Nothing is impossible. Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198 Consultant / http://p6m7g8.net/Resume/ Senior Developer / Liquidity Services, Inc. http://www.liquidityservicesinc.com http://www.liquidation.com http://www.uksurplus.com http://www.govliquidation.com http://www.gowholesale.com
Re: dir_config
Christopher H. Laco wrote: While I'm at it...what's the Apache2:: equivilent of SCRIPT_NAME? $r-uri See: http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_uri_ In the future, try to post new questions as a separate email, not as a reply to an existing thread. Makes it harder to identify what the e-mail is about. -- Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5 signature.asc Description: OpenPGP digital signature
Can't start Apache2 with mod_perl2
Hi, everyone. I really have a problem. I did install mod_perl on Apache 1.33 but later I decided to move to Apache2, so I install mod_perl2 too and I remove both apache 1.33 and mod_perl 1.99. Then, when I put LoadModule perl_module /usr/lib/apache2/modules/mod_perl.so in the httpd.conf file and try to start Apache2 I got the following error: Can't locate Apache2.pm in @INC I already tried everything that I read, but I did not have any solution yet. I really apreciated if someone tell me what the problem is! Thanks a lot! Ana Maygreth Azuaje Olivo Venezuela Telfs: 0414-5243348/0416-4535939 __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! Regístrate ya - http://correo.espanol.yahoo.com/
Re: Can't start Apache2 with mod_perl2
Ana Azuaje wrote: Can't locate Apache2.pm in @INC Please Read: http://perl.apache.org/docs/2.0/rename.html -- END What doesn't kill us can only make us stronger. Nothing is impossible. Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198 Consultant / http://p6m7g8.net/Resume/ Senior Developer / Liquidity Services, Inc. http://www.liquidityservicesinc.com http://www.liquidation.com http://www.uksurplus.com http://www.govliquidation.com http://www.gowholesale.com
Re: Can't start Apache2 with mod_perl2
Please Read: http://perl.apache.org/docs/2.0/rename.html I'm sorry but I can't understand where I have to make these changes. It's so embarrassing to me but I'm a stuck. I'm wondering if you could explain more... thanks a lot! --- Philip M. Gollucci [EMAIL PROTECTED] escribió: Ana Azuaje wrote: Can't locate Apache2.pm in @INC Please Read: http://perl.apache.org/docs/2.0/rename.html -- END What doesn't kill us can only make us stronger. Nothing is impossible. Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198 Consultant / http://p6m7g8.net/Resume/ Senior Developer / Liquidity Services, Inc. http://www.liquidityservicesinc.com http://www.liquidation.com http://www.uksurplus.com http://www.govliquidation.com http://www.gowholesale.com Ana Maygreth Azuaje Olivo Venezuela Telfs: 0414-5243348/0416-4535939 __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! Regístrate ya - http://correo.espanol.yahoo.com/