Re: CGI::Simple 0.077

2005-03-15 Thread Joshua N Pritikin
On Tue, 2005-03-15 at 23:21 -0500, Perrin Harkins wrote: > On Wed, 2005-03-16 at 08:47 +0530, Joshua N Pritikin wrote: > > CGI::Simple doesn't work with mod_perl 1.999.20: > > > > $data = $self->{'.mod_perl'} ? Apache->request->args : > > $ENV{'QUERY_STRING'} || $ENV{'REDIRECT_QUERY_ST

Re: CGI::Simple 0.077

2005-03-15 Thread Perrin Harkins
On Wed, 2005-03-16 at 08:47 +0530, Joshua N Pritikin wrote: > CGI::Simple doesn't work with mod_perl 1.999.20: > > $data = $self->{'.mod_perl'} ? Apache->request->args : > $ENV{'QUERY_STRING'} || $ENV{'REDIRECT_QUERY_STRING'} || ''; > > Apache->request->args returns an Apache::RequestR

Re: mod_perl/Apache troubles with cell phone

2005-03-15 Thread Rodger Castle
Perrin, My first inclination upon reading this post was "Silly, of course I checked the headers." However, upon doing what you suggested by putting the CGI.pm script and mod_perl version side by side in lynx, the only difference was the following header: Cache-Control:

Re: shared memory

2005-03-15 Thread Scott Gifford
André Warnier <[EMAIL PROTECTED]> writes: [...] > I have previously gone though a lot of perl and mod_perl > documentation, and perl module descriptions, and I never seemed to > find a clear answer about wether yes or no it was possible to share > in-memory data between 2 perl processes (or threa

Re: mod_perl/Apache troubles with cell phone

2005-03-15 Thread Perrin Harkins
On Sat, 2005-03-12 at 18:25 -0500, Rodger Castle wrote: > I got around the immediate problem by a per-file directive > for the particular script in question and writing it with CGI.pm with > no problems. This almost certainly means that your mod_perl script is not sending out the right headers.

CGI::Simple 0.077

2005-03-15 Thread Joshua N Pritikin
CGI::Simple doesn't work with mod_perl 1.999.20: $data = $self->{'.mod_perl'} ? Apache->request->args : $ENV{'QUERY_STRING'} || $ENV{'REDIRECT_QUERY_STRING'} || ''; Apache->request->args returns an Apache::RequestRec instead of a native perl data structure. What is the new magic to ge

Re: shared memory

2005-03-15 Thread jonathan vanasco
And we appreciate it. :) ditto

Re: shared memory

2005-03-15 Thread Ofer Nave
Perrin Harkins wrote: I just want to make it very clear to people that they should not fork with an open db handle and then try to use it. And we appreciate it. :) -ofer

Re: [OT] Performance Question

2005-03-15 Thread Perrin Harkins
On Tue, 2005-03-15 at 19:32 -0500, jonathan vanasco wrote: > here's where mp2 comes in -- instead of writing out the hashed > directory path, i was thinking about just writing the image name and > hosting it off a location directive that would hash file requests > transparently Just use mod_rew

Re: Cleanup Handler, Class::DBI and Oracle

2005-03-15 Thread Perrin Harkins
David, First things first: are you running proxy servers in front of these? That is the most effective way to reduce the number of mod_perl processes and thus the number of connections to Oracle. > The reason there is 1200 connections is because we > have 7 servers that run between 150-300 child

Re: shared memory

2005-03-15 Thread Perrin Harkins
On Tue, 2005-03-15 at 19:40 -0500, jonathan vanasco wrote: > On Mar 15, 2005, at 7:30 PM, Perrin Harkins wrote: > > > Don't fork with an open database connection and then try to use it. It > > will not work. > > Really? I figured that it would work just right -- except whatever > you programm

Re: shared memory

2005-03-15 Thread jonathan vanasco
On Mar 15, 2005, at 7:30 PM, Perrin Harkins wrote: Don't fork with an open database connection and then try to use it. It will not work. Really? I figured that it would work just right -- except whatever you programmed to use that will crash and burn and time out waiting to access the single s

Cleanup Handler, Class::DBI and Oracle

2005-03-15 Thread David J Radunz
Hey All, I have a problem that for some reason at any given time there is 1200 connections open to our Oracle database. This of course means that oracle keeps running out of memory which is bad. I know persistent connections are good and all, but when they kill the database then it becomes an is

[OT] Performance Question

2005-03-15 Thread jonathan vanasco
I'm marking this questions OT because its not entirely mod_perl, but not entirely not-mod_perl... I'm going to serve a potentially large amount of images , so have decided to use directory hashing to store them, along with either sequential numbering or a 32char hex identifier -- so abcdefg.jp

Re: shared memory

2005-03-15 Thread Perrin Harkins
On Tue, 2005-03-15 at 18:40 -0500, Jonathan Vanasco wrote: > If you instantiate a DBI handle before the fork, then that handle is > shared to all the children. If you instantiate the handle after the > fork, the handle belongs to only that child , and shared across the > requests of that child.

Re: shared memory

2005-03-15 Thread Perrin Harkins
On Wed, 2005-03-16 at 00:26 +0100, André Warnier wrote: > I have previously gone though a lot of perl and mod_perl documentation, > and perl module descriptions, and I never seemed to find a clear answer > about wether yes or no it was possible to share in-memory data between 2 > perl processes

Re: localized lexical varibles

2005-03-15 Thread Perrin Harkins
On Tue, 2005-03-15 at 22:27 +0300, Vladimir D Belousov wrote: > As I know, my module has been loaded only once and has been loaded by > the root httpd process. > And when any httpd forks exist (prefork), let's present next situation: > one of the existing httpd forks changes value of any variable

Re: shared memory

2005-03-15 Thread Eric Wilhelm
# The following was supposedly scribed by # André Warnier # on Tuesday 15 March 2005 05:26 pm: >On the other hand, mod_perl seems to have some deep interactions with >the innards of the Apache server, for example direct manipulation of > the "bucket brigades".  How come no-one has come up yet with

Re: shared memory

2005-03-15 Thread Jonathan Vanasco
He's my naive understanding of your concerns, someone here may have to correct me: On Mar 15, 2005, at 6:26 PM, André Warnier wrote: I have previously gone though a lot of perl and mod_perl documentation, and perl module descriptions, and I never seemed to find a clear answer about wether yes o

Re: shared memory

2005-03-15 Thread André Warnier
Perrin Harkins wrote: On Tue, 2005-03-15 at 23:26 +0100, André Warnier wrote: Do I get the feeling this is getting a bit off-topic ? :-) That's because we believe we answered your question and are now talking about interesting side-topics. a) is it possible/easy to share this data between a numbe

Re: shared memory

2005-03-15 Thread André Warnier
to Skylos (and Jonathan before), Skylos wrote: memcached has nothing specifically to do with database access speed. It is a general purpose shared cache utility that can be accessed by all the systems on a platform independant basis. [...] Sorry, I misunderstood the information on the homepage of

Re: shared memory

2005-03-15 Thread Perrin Harkins
On Tue, 2005-03-15 at 23:26 +0100, André Warnier wrote: > Do I get the feeling this is getting a bit off-topic ? :-) That's because we believe we answered your question and are now talking about interesting side-topics. > a) is it possible/easy to share this data between a number of > Apache2/mo

Re: shared memory

2005-03-15 Thread André Warnier
Perrin Harkins wrote: On Tue, 2005-03-15 at 15:05 -0500, Jonathan Vanasco wrote: i've found sqlite3 to be wy faster than mysql for simple transactions and, while there can be delays from locking, the speed improvements of querying more than make up for it in the instances I've tested Sounds

Re: shared memory

2005-03-15 Thread Perrin Harkins
On Tue, 2005-03-15 at 15:05 -0500, Jonathan Vanasco wrote: > i've found sqlite3 to be wy faster than mysql for simple > transactions and, while there can be delays from locking, the speed > improvements of querying more than make up for it in the instances I've > tested Sounds good. I'll s

Re: shared memory

2005-03-15 Thread Jonathan Vanasco
i've found sqlite3 to be wy faster than mysql for simple transactions and, while there can be delays from locking, the speed improvements of querying more than make up for it in the instances I've tested obviously, its not an answer to everything -- but for some situations, its quite nice

Re: shared memory

2005-03-15 Thread Dan Sully
* Perrin Harkins shaped the electrons to say... On Tue, 2005-03-15 at 14:11 -0500, Jonathan Vanasco wrote: sqlite3 is closer in speed to bdb than mysql, and offers more of the 'accessibility' that mysql offers. i find myself using it much more than bdb lately SQLite2 was pretty slow when I benchma

Re: shared memory

2005-03-15 Thread Perrin Harkins
On Tue, 2005-03-15 at 14:11 -0500, Jonathan Vanasco wrote: > sqlite3 is closer in speed to bdb than mysql, and offers more of the > 'accessibility' that mysql offers. > i find myself using it much more than bdb lately SQLite2 was pretty slow when I benchmarked it for simple hash-like usage. MySQ

Re: localized lexical varibles

2005-03-15 Thread Vladimir D Belousov
Michael Peters wrote: Vladimir D Belousov wrote: Tom Schindl wrote: Vladimir D Belousov wrote: [skipped] The variables would get reinitialized if you passed them in as arguments. The link that I sent you explains that once the Call sub is compiled it creates a closure around the $r and $s varia

Re: localized lexical varibles

2005-03-15 Thread Vladimir D Belousov
Michael Peters wrote: Vladimir D Belousov wrote: [skipped] You're creating a closure with $s and $r. Check out http://perl.apache.org/docs/general/perl_reference/perl_reference.html#Understanding_Closuresthe_Easy_Way to understand why this causes strange behavior. Thank you! I searched for

Re: shared memory

2005-03-15 Thread Jonathan Vanasco
sqlite3 is closer in speed to bdb than mysql, and offers more of the 'accessibility' that mysql offers. i find myself using it much more than bdb lately On Mar 15, 2005, at 1:04 PM, Perrin Harkins wrote: This is true, but it sounds like Andre wants to replace a bespoke database structure with so

Re: Restarting apache from child?

2005-03-15 Thread Scott Gifford
"Jain, Abhay K, ALABS" <[EMAIL PROTECTED]> writes: [...] > Scripts such as perl or ksh do not become root with setuid. > They really do not get the same privilege. Setuid to root > works ok with a compiled executable. It's OS-specific, so that may or may not be true. Some OS's, like Solaris, im

Re: localized lexical varibles

2005-03-15 Thread Michael Peters
Vladimir D Belousov wrote: Tom Schindl wrote: Vladimir D Belousov wrote: You are creating a closure here for $s here. There enough material out there go and read about closures(See Apache::Registry). Why do you embed a sub into a sub? I hope this sub will be mmm... "localized subroutine" and al

Re: localized lexical varibles

2005-03-15 Thread Vladimir D Belousov
Tom Schindl wrote: Vladimir D Belousov wrote: [skipped] You are creating a closure here for $s here. There enough material out there go and read about closures(See Apache::Registry). Why do you embed a sub into a sub? I hope this sub will be mmm... "localized subroutine" and all varibles in one

RE: Restarting apache from child?

2005-03-15 Thread Jain, Abhay K, ALABS
-Original Message- From: Scott Gifford [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 15, 2005 11:54 AM To: Maxim Nechaev Cc: modperl@perl.apache.org Subject: Re: Restarting apache from child? Maxim Nechaev <[EMAIL PROTECTED]> writes: > I need to restart or graceful restart apache server

Re: shared memory

2005-03-15 Thread Perrin Harkins
On Tue, 2005-03-15 at 17:47 +, Martin Moss wrote: > I haven't used Memchache yet, but it has nothing to do > with databases > It CAN be used to prevent database load, OR it could > be used to prevent too much access to flocking > files... This is true, but it sounds like Andre wants to re

Re: shared memory

2005-03-15 Thread Martin Moss
--- André Warnier <[EMAIL PROTECTED]> wrote: > Jonathan Vanasco wrote: > > > > look into memcached -- http://danga.com/memcached/ > > Thank you for the link, I didn't know that module, > and I'll keep it in > mind for some other projects. > But it is slightly off the mark as far as the issue >

Re: localized lexical varibles

2005-03-15 Thread Tom Schindl
Vladimir D Belousov wrote: Hallo all! I'm new to mod_perl, and I see the strange behaviour of local variables in functions. This is my simple test: == .htaccess: SetHandler perl-script PerlHandler My::Test; == package My::Test; #/usr/local/apache/My/Test.pm use strict; use Apache::Constants ':com

Re: localized lexical varibles

2005-03-15 Thread Michael Peters
Vladimir D Belousov wrote: Hallo all! I'm new to mod_perl, and I see the strange behaviour of local variables in functions. This is my simple test: == .htaccess: SetHandler perl-script PerlHandler My::Test; == package My::Test; #/usr/local/apache/My/Test.pm use strict; use Apache::Constants ':com

localized lexical varibles

2005-03-15 Thread Vladimir D Belousov
Hallo all! I'm new to mod_perl, and I see the strange behaviour of local variables in functions. This is my simple test: == .htaccess: SetHandler perl-script PerlHandler My::Test; == package My::Test; #/usr/local/apache/My/Test.pm use strict; use Apache::Constants ':common'; sub handler { my $

Re: Apache::Cookie baking bug

2005-03-15 Thread Joe Schaefer
"Andrea Palmieri" <[EMAIL PROTECTED]> writes: > I read in some previous message that Apache::Cookie->bake is buggy so used > $r->headers_out->add('Set-Cookie'=>$cookie); Try err_headers_out; I'm not the headers_out table is copied to an internal redirect. -- Joe Schaefer

Re: shared memory

2005-03-15 Thread André Warnier
Jonathan Vanasco wrote: look into memcached -- http://danga.com/memcached/ Thank you for the link, I didn't know that module, and I'll keep it in mind for some other projects. But it is slightly off the mark as far as the issue below is concerned. Maybe it was my mentioning "data in tables" that w

Re: Restarting apache from child?

2005-03-15 Thread Scott Gifford
Maxim Nechaev <[EMAIL PROTECTED]> writes: > I need to restart or graceful restart apache server from one of his > child. It is possible? If yes, how to do this more correctly? The main Apache process runs as root, and each Apache child process runs as a less-privileged user, and so would not have

Apache::Cookie baking bug

2005-03-15 Thread Andrea Palmieri
I read in some previous message that Apache::Cookie->bake is buggy so used   $r->headers_out->add('Set-Cookie'=>$cookie);to send a cookie to a browser but..no way the browser do not receive any cookie !!! did I miss something ? Below I enclose my code fragment. Any help is apreciated Tha

Re: shared memory

2005-03-15 Thread Jonathan Vanasco
look into memcached -- http://danga.com/memcached/ On Mar 15, 2005, at 11:35 AM, André Warnier wrote: Hello list. Having looked hi and lo for definite information on the subject, found a lot but a bit confusing... Environment : Apache 2 / mod_perl 2 / perl 5.8.4+ Windows and Unix(es) Apache mod_p

shared memory

2005-03-15 Thread André Warnier
Hello list. Having looked hi and lo for definite information on the subject, found a lot but a bit confusing... Environment : Apache 2 / mod_perl 2 / perl 5.8.4+ Windows and Unix(es) Apache mod_perl2 Handlers The basic question is : does there exist a platform-independent way for a bunch of apache2

Re: [BUG] line numbering off-by-one with Apache::DB and RegistryCooker

2005-03-15 Thread Stas Bekman
Dominique Quatravaux wrote: Actually it was one, but Thunderbird munged it :-(. Retrying with mutt... Sorry for yet another blunder. [...] - 'w' => sub { "use warnings;\n" }, + 'w' => sub { "use warnings; " }, ); sub rewrite_shebang { In which case you will end up with use warnings on the s

Re: [BUG] line numbering off-by-one with Apache::DB and RegistryCooker

2005-03-15 Thread Dominique Quatravaux
> Thanks, Dominique. But care to post a unified patch? 'diff -u' > Thanks! Actually it was one, but Thunderbird munged it :-(. Retrying with mutt... Sorry for yet another blunder. Index: ModPerl-Registry/lib/ModPerl/RegistryCooker.pm ===