Perl Registry ... Memory consumption.
Hi, I've been trying to setup mod_perl in an Apache/Red Hat Linux/mySQL environment for the last couple of weeks. When running Apache::Registry on production, mod_perl chewed up all the available memory (at that stage only 64 Meg) and the system started to use swap memory. So we doubled the memory to 128 Meg and over the next 10 minutes of using the site (having restarted the server) we watched as all the extra memory was used up and it went back into swap! So here are some questions: 1. What is a 'ball-park' figure for mod_perl memory requirements? 2. What is the entry level spec for a mod_perl/Apache/Linux server? 3. Should I reduce the number of Apache child processes (currently 10) ... to reduce memory consumption? 4. Will mod_perl always ramp up its memory consumption to whatever is available? 5. Should we throw money at the problem and just buy more memory? 6. I have not been able to get Apache::DBI to work. Will Apache::DBI significantly reduce memory consumption (every script opens a DB handle for session checking)? Any help, and war stories that you may have would be much appreciated ... Nige On Sun, 2 Jul 2000, Christopher Suarez wrote: I'm running rh linux 6.2 on a laptop and have tried for sometime to get apache::DBI runnning. modperl wokrs fine with apache but when I add the line PerlModule Apache::DBI to srm.conf, httpd.conf or "use Apache::DBI" to startup.pl and then PerlRequire /path/startup.pl to httpd.conf it won't work. apache will start ok(saying it's using mod_perl) but won't shut down ok and error_log doesn't say anythings wrong. the webserver won't response on contacting 127.0.0.1 in a browser it'll response connection refused. versions: apache-1.3.12-2 apache-devel-1.3.12-2 perl-2.00503-10 perl-DBI-1.13-1 perl-DBD-msql-mysql-1.2210-1 perl-Apache-DBI-0.01-2 perl-Apache-DBILogin-1.5-2 perl-Apache-DBILogger-0.93-2 perl-Apache-RedirectDBI-0.01-2 mod_perl-1.21-10 strange???
Re: Perl Registry ... Memory consumption.
Nigel Hamilton [EMAIL PROTECTED] writes: Hi, I've been trying to setup mod_perl in an Apache/Red Hat Linux/mySQL environment for the last couple of weeks. When running Apache::Registry on production, mod_perl chewed up all the available memory (at that stage only 64 Meg) and the system started to use swap memory. So we doubled the memory to 128 Meg and over the next 10 minutes of using the site (having restarted the server) we watched as all the extra memory was used up and it went back into swap! So here are some questions: 1. What is a 'ball-park' figure for mod_perl memory requirements? http://perl.apache.org/guide 2. What is the entry level spec for a mod_perl/Apache/Linux server? http://perl.apache.org/guide 3. Should I reduce the number of Apache child processes (currently 10) ... to reduce memory consumption? http://perl.apache.org/guide 4. Will mod_perl always ramp up its memory consumption to whatever is available? http://perl.apache.org/guide 5. Should we throw money at the problem and just buy more memory? http://perl.apache.org/guide 6. I have not been able to get Apache::DBI to work. Will Apache::DBI significantly reduce memory consumption (every script opens a DB handle for session checking)? Put it _first_ in startup.pl. Any help, and war stories that you may have would be much appreciated ... http://perl.apache.org/guide ;-) -- Dave Hodgkinson, http://www.hodgkinson.org Editor-in-chief, The Highway Star http://www.deep-purple.com Apache, mod_perl, MySQL, Sybase hired gun for, well, hire -
Re: Virtual Hosts and POST
Jay J wrote: Jon Wyatt wrote: [EMAIL PROTECTED] wrote: Simple first stage question:- Your not using mod_rewrite at all (it took me 6 hours to work out that that was causing the same problem for me). I wasn't but I am now and it's made no difference. I'm going to change my mind now. I'm still not using it. To use that mod surely I need to do the following:- Edit Configure to enable the mod_rewrite perl Makefile.PL .{with everything enabled} make make install cd apache dir make install The mod is now statically linked in, right? Or am I completely wrong? Jon. --enable-module=rewrite FYI, unless you have 'RewriteEngine on' and rules/etc .. this really shouldn't interfere. This was the problem. The mod wasn't enabled but the rule was in there. I'm still having problems enabling the mod which is a bit worrying but that's a different story, I may ask for assistance later. Thanks both for your help. Jon.
Script that stays on the same page
Hello, For my server, I need to write some script that will be 'regularly' triggered (GET or POST), but that will NOT send the user to another page. The user must stay on the same page he is, without ANY html being exchanged as a result of the script. This will be used to change parameters on the user's session, but since those params will not affect the page the user is currently looking at, there is no need to send HTML back. So, 1/ can it be done ? 2/ How ? TIA, -- -+-+ Pierre-Yves BONNETAIN (aka Pyb) Consultant Internet/Sécurité --- B A Consultants Tel : 0 563.277.241 - Fax : 0 563.277.245
possible?
Dear mod_perl users. Is it possible to have an apache with --enable-shared=max and mod_perl statically linked? If yes please tell me how to do, i need mod_perl statically cause otherwise my Apache::ASP won't work. Sincerely Vincent Bruijnes [EMAIL PROTECTED]
User pressed stop?
Every so often I get: Broken pipe: client stopped connection before rflush completed In my error log. Is that the "user pressed stop" condition? AxKit just sends raw files (unless in no_cache mode), i.e. it sets $r-filename() and then returns DECLINED. Do I need to handle this, or can I just ignore it? -- Matt/ Fastnet Software Ltd. High Performance Web Specialists Providing mod_perl, XML, Sybase and Oracle solutions Email for training and consultancy availability. http://sergeant.org | AxKit: http://axkit.org
Re: Perl Registry ... Memory consumption.
first off, David Hodgkinson's comments are correct... Stas's guide is very thorough, and covers pretty much all of this. On Mon, 3 Jul 2000, Nigel Hamilton wrote: Hi, I've been trying to setup mod_perl in an Apache/Red Hat Linux/mySQL environment for the last couple of weeks. When running Apache::Registry on production, mod_perl chewed up all the available memory (at that stage only 64 Meg) and the system started to use swap memory. So we doubled the memory to 128 Meg and over the next 10 minutes of using the site (having restarted the server) we watched as all the extra memory was used up and it went back into swap! So here are some questions: 1. What is a 'ball-park' figure for mod_perl memory requirements? There is no such thing. It depends entirely on your application. A client of ours runs a modperl based sniffer, and that familty of mod_perl httpds can hardly be told appart from a normal family but he only has a few scripts, and they "don't do much" (log some info and throw out a 47 byte transparent gif). on the otherhand, if you application deals with big strings, lots of database queries (per page), etc... then it will be much more resource intensive. 2. What is the entry level spec for a mod_perl/Apache/Linux server? depends on your application, but these days I wouldn't even bother staging a machine with less than 192 meg of RAM it is cheap compared to the cost of having to piss around with your box or buy faster drives. 3. Should I reduce the number of Apache child processes (currently 10) ... to reduce memory consumption? you haven't said whether you're using mod_proxy and a front_end/back_end config (see the guide). You haven't said how many simultaneous hits you expect... 4. Will mod_perl always ramp up its memory consumption to whatever is available? no. 5. Should we throw money at the problem and just buy more memory? As I see it, you have two choices: take the time to figure out what part of your app is using up memory, or buy more memory... 6. I have not been able to get Apache::DBI to work. Will Apache::DBI significantly reduce memory consumption (every script opens a DB handle for session checking)? I strongly doubt it. If anything the connection caching is going to cost you memory... Apache::DBI is intended to save CPU cycles. Any help, and war stories that you may have would be much appreciated ... Nige On Sun, 2 Jul 2000, Christopher Suarez wrote: I'm running rh linux 6.2 on a laptop and have tried for sometime to get apache::DBI runnning. modperl wokrs fine with apache but when I add the line PerlModule Apache::DBI to srm.conf, httpd.conf or "use Apache::DBI" to startup.pl and then PerlRequire /path/startup.pl to httpd.conf it won't work. apache will start ok(saying it's using mod_perl) but won't shut down ok and error_log doesn't say anythings wrong. the webserver won't response on contacting 127.0.0.1 in a browser it'll response connection refused. versions: apache-1.3.12-2 apache-devel-1.3.12-2 perl-2.00503-10 perl-DBI-1.13-1 perl-DBD-msql-mysql-1.2210-1 perl-Apache-DBI-0.01-2 perl-Apache-DBILogin-1.5-2 perl-Apache-DBILogger-0.93-2 perl-Apache-RedirectDBI-0.01-2 mod_perl-1.21-10 strange??? -- [EMAIL PROTECTED] | Don't go around saying the world owes you a living; http://BareMetal.com/ | the world owes you nothing; it was here first. web hosting since '95 | - Mark Twain
Compiling Apache 1.3.12 on Hp_UX 11
For those of you who were able to compile Apache Server 1.3.12 on HP-UX 11... In the documentation for Dynamic Shared Object (DSO) Support ( under heading Implementation in the dso.html page ) it is mentioned that the mod_so.c is the only module besides http_core.c which cannot be put into a DSO itself (bootstrapping!). This module needs to be statically compiled into the Apache core. Currently, when I run 'httpd -l' I am getting the following output Compiled-in modules: httpd_core.c mod_so.c suexec: disabled; invalid wrapper /usr/local/apache/bin/suexec In the ./src/Configuration file only the two following lines are modified EXTRA_CFLAGS= -DSHARED_CORE_DIR=\"/usr/local/apache/libexec\" Rule SHARED_CORE=yes The 'configure' command was run as follows. ./configure --prefix=/usr/local/apache \ --enable-rule=SHARED_CORE \ --enable-module=most \ --enable-shared=max The output appears to be ok. When the command 'make' is run, I am getting the following error ld: invalid loader fixup in text space needed to output file for symbol "001B" in inputfile "regex/libregex.a(regcomp.o) My question: What command line suEXEC options I should give for it to not give the "invalid wrapper" above ?. Am I doing the wrong things by specifying the two variables in the Configuration file and the --enable-rule option for the 'configure' command?. Any suggestions would be very much appreciated.
Re: bogus taint error?
At 10:49 AM -0500 7/3/2000, Matt Carothers wrote: On Sun, 2 Jul 2000, Michael Blakeley wrote: This is just plain weird. My last resort was to turn taint off: $ ls -l logs/httpd.pid -rw-rw-rw- 1 root other 6 Jul 2 19:23 logs/httpd.pid $ grep -i taint conf/httpd.conf #PerlTaintCheck On $ ls -l conf/httpd.conf -rw-r--r-- 1 root other 7437 Jul 2 17:22 conf/httpd.conf I'm not including any sort of startup.pl file. So taint is off, right? Is the script running setuid or setgid? If the script's real and effective uids or gids don't match, perl enables taint mode automatically. You might add some debugging code to verify that $ == $ and $( == $). There's no sticky bit on the file, and the uid and gid of the file are the same as the apache user. I think I may have an answer for taint's on-when-off behavior: I'd been syncing /usr/local/lib/perl5 all along, but it seems that some of the perl binaries may have drifted apart. Since syncing them up, #PerlTaintCheck On seems to disable taint, as it should. I'm not sure what drifted out of sync - I haven't rebuilt perl, apache, or mod_perl in months. But I still have to turn PerlTaintCheck off in production, even though the same script, on the same OS, with the same perl binaries and libraries, and the same mod_perl and apache binaries, works fine for dev. I'd love to understand why - a race condition triggered by high concurrency, maybe? So far I haven't been able to trigger it with ab -c 5 -n 1000 against the dev server. -- Mike
Re: bogus taint error?
At 11:48 AM -0400 7/3/2000, Vivek Khera wrote: "MB" == Michael Blakeley [EMAIL PROTECTED] writes: MB At 3:37 PM -0700 7/2/2000, Michael Blakeley wrote: At 2:00 PM -0700 7/2/2000, Michael Blakeley wrote: With perl 5.6.0, Solaris 2.6, apache 1.3.9, and mod_perl 1.24, I'm seeing intermittent taint errors like [Sat Jul 1 18:50:13 2000] [error] PerlRun: `Insecure dependency in require while running with -T switch at /foo.pl line 5. MB This is just plain weird. My last resort was to turn taint off: I've had to do that on a production server as well. The development box still works fine with taint on, curiously enough. The production box *used* to work fine with taint checks, and then suddenly one day decided to stop working. What platform and version of perl do you use? Perhaps there's a correlation. Oddly, this is the first real difficulty I've had since moving to 5.6.0. There are some known bugs in 5.6.0 now, but I don't know if any of them are relevant to this problem thanks, -- Mike
Re: bogus taint error?
"MB" == Michael Blakeley [EMAIL PROTECTED] writes: box *used* to work fine with taint checks, and then suddenly one day decided to stop working. MB What platform and version of perl do you use? Perhaps there's a MB correlation. Perl 5.004_04 on BSD/OS 4.0, and perl 5.005_02 on Solaris 2.6. Versions of mod_perl vary. The BSD/OS is kept up with CVS, but the solaris is a production server and kept unchanged. That's the one that just decided taint checking was going to stop every script dead in its tracks. Must have been the phase of the moon or something.
Re: Can't find Apache::DBI on Win32 version
On Mon, 3 Jul 2000, David Jourard wrote: Hi, I'm running the win32 version. I changed the httpd.conf file to include: Apache::DBI I get that it cannot be found. [ ... ] Apache::DBI doesn't need a C compiler to install, so you should be able to just do c:\ perl -MCPAN -e shell cpan install Apache::DBI Or, alternatively, get the distribution from http://www.perl.com/CPAN/authors/id/M/ME/MERGL/, unpack it, and run perl Makefile.PL nmake nmake install If you don't have nmake, you can get a self-extracting archive from ftp://ftp.microsoft.com/softlib/MSLFILES/nmake15.exe. best regards, randy kobes
!--#config timefmt=blahblahblah-- with Apache::SSI
Hi, Does anyone knows, why standard SSI-Tag: !--#config timefmt="%blah"-- doesn't work with Apache::SSI (maybe it's currently not supported)??? Other used SSI-Tags are interpreted perfectly by Apache::SSI. Thank you, Stephan
RE: apache::DBI
Okay, so if it seems that Redhat 6.1/6.2 Apache mod_perl is broken.. Anyone have a good guide/website to get apache mod_perl compiled properly? I've been reading the fine manuals and compiled httpd with mod_perl (by using the Makefile.PL from the mod_perl src tree.) When I list the modules compiled in the httpd, I do see the mod_perl.c , however, trying to get the server up and running just fails. It does the same thing as I would add the keyword PerlModule Apache::DBI in the httpd.conf from the out-of-the-box apache mod_perl from redhat 6.2 (the httpd seems to load, but it dies, because I'm unable to telnet on port 80 and there are no logs of the crash). Help? -Original Message- From: Guo Bin [mailto:[EMAIL PROTECTED]] Sent: July 2, 2000 9:18 PM To: Christopher Suarez; [EMAIL PROTECTED] Subject: Re: apache::DBI Though not using rh 6.2, my experience on 6.1 was the same --- apache will crash whenever use Apache::DBI is included in httpd.conf. I'm now using manually compiled apache and modperl and they are working fine. Hope this will also work for 6.2. On small glitch, Apache::Status cannot show Apache::DBI connections on rh 6.1 i386, while the same setting works on a rh 6.1 sparc! -- Guo Bin --- Christopher Suarez [EMAIL PROTECTED] wrote: I'm running rh linux 6.2 on a laptop and have tried for sometime to get apache::DBI runnning. modperl wokrs fine with apache but when I add the line PerlModule Apache::DBI to srm.conf, httpd.conf or "use Apache::DBI" to startup.pl and then PerlRequire /path/startup.pl to httpd.conf it won't work. apache will start ok(saying it's using mod_perl) but won't shut down ok and error_log doesn't say anythings wrong. the webserver won't response on contacting 127.0.0.1 in a browser it'll response connection refused. versions: apache-1.3.12-2 apache-devel-1.3.12-2 perl-2.00503-10 perl-DBI-1.13-1 perl-DBD-msql-mysql-1.2210-1 perl-Apache-DBI-0.01-2 perl-Apache-DBILogin-1.5-2 perl-Apache-DBILogger-0.93-2 perl-Apache-RedirectDBI-0.01-2 mod_perl-1.21-10 strange??? __ Do You Yahoo!? Kick off your party with Yahoo! Invites. http://invites.yahoo.com/
RE: !--#config timefmt=blahblahblah-- with Apache::SSI
-Original Message- From: Roediger Stephan [mailto:[EMAIL PROTECTED]] Sent: Monday, July 03, 2000 9:38 AM To: '[EMAIL PROTECTED]' Subject: !--#config timefmt=blahblahblah-- with Apache::SSI Hi, Does anyone knows, why standard SSI-Tag: !--#config timefmt="%blah"-- doesn't work with Apache::SSI (maybe it's currently not supported)??? Other used SSI-Tags are interpreted perfectly by Apache::SSI. Thank you, Stephan I came across this as well when one of our templates which uses SSI to format a time. I subclass Apache::SSI and overwrote the ssi_echo and echo _DATE_LOCAL method. As far as I can tell there is an environment variable called DATE_LOCAL which keeps sub_DATE_LOCAL from ever getting called and this seems to ignore any settings made through the ssi_config method in Apache::SSI. Probably a better way to fix this, but this works for me. -- sang package MySSI; sub BEGIN { use Date::Format; use base qw(Apache::SSI); } sub ssi_echo { my($self, $args) = @_; my $var = $args-{var}; $self-_interp_vars($var); my $value; no strict('refs'); if ($var eq 'DATE_LOCAL') { return $self-echo_DATE_LOCAL; } elsif (exists $ENV{$var}) { return $ENV{$var}; } elsif ( defined ($value = $self-{_r}-subprocess_env($var)) ) { return $value; } elsif (defined {"echo_$var"}) { return {"echo_$var"}($self-{_r}); } return ''; } sub echo_DATE_LOCAL { my $self = shift; if(exists $self-{timefmt}) { return time2str($self-{timefmt},time) ? time2str($self-{timefmt},time) : scalar localtime; } return 1+time; return scalar localtime; } 1;
Strange delays
Once in a while the first page being requested by a client is delayed by approximately 10s, even though there is no significant load on the server. Usual delays are between 0 and 1s, rarely up to 4s (complex database queries). Any Ideas where to look for the cause of this? I first thought the problem might be with the database connections. However these same delays also happen with pages, that don't need to connect at all... -- Eric Jain httpd.conf -- ... Timeout 300 KeepAliveOn MaxKeepAliveRequests 100 KeepAliveTimeout 5 MinSpareServers 10 MaxSpareServers 20 StartServers 10 MaxClients 30 MaxRequestsPerChild 1000 ... startup.pl -- use strict; use Apache::GTopLimit; $Apache::GTopLimit::MAX_PROCESS_SIZE = 15000; require BioDoc::Page; require BioDoc::SQL; use DBI (); DBI-install_driver("Pg"); use CGI (); CGI-compile(':standard'); 1;