Re: Does mod_perl have anything to do with KeepAlive?

2000-11-28 Thread David Hodgkinson

Larry Leszczynski [EMAIL PROTECTED] writes:

 Hi All -
 
 I'm hoping for some enlightenment about how KeepAlive is implemented in
 Apache and whether KeepAlive even comes into play when front-end and
 back-end mod_perl servers communicate with each other via HTTP.

http://thingy.kcilink.com/modperlguide/performance/KeepAlive.html


-- 
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
  -

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Does mod_perl have anything to do with KeepAlive?

2000-11-28 Thread Stas Bekman

On Mon, 27 Nov 2000, Larry Leszczynski wrote:

 Hi All -
 
 I'm hoping for some enlightenment about how KeepAlive is implemented in
 Apache and whether KeepAlive even comes into play when front-end and
 back-end mod_perl servers communicate with each other via HTTP.

http://perl.apache.org/guide/performance.html#KeepAlive
 
 Suppose front-end server A is handling user requests.  In the process of
 handling a front-end request, suppose I use LWP or equivalent to make a
 HTTP request from A to a back-end server B to get some data that is
 needed.  Assuming all the right headers are set for KeepAlive to work
 (content length, etc.), can the connection between A and B even take
 advantage of KeepAlive for the next time A makes the same request to B?

 One problem is that I'm not sure what processes would actually be
 "keeping" the ends of the "kept alive" connections.  At each end, would it
 be the parent httpd process, or the individual httpd child process that
 made/answered the request?
 
 I'm thinking that if A had to fork a CGI that in turn talked to B, the
 kept-alive connection would be lost as soon as the CGI process on A died
 (socket timeouts notwithstanding).  But what if the request from A to B is
 made from within a mod_perl module, or within an Apache::Registry script?
 
 Along the same line of thought (assuming this has made any sense so far),
 what happens when you throw ProxyPass/ProxyPassReverse into the mix?  What
 (if anything) can be done to take advantage of KeepAlive then?
 
 
 Larry Leszczynski
 [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Using MHonArc inside of mod_perl

2000-11-28 Thread darren chamberlain

Aaron Johnson ([EMAIL PROTECTED]) said something to this effect:
 I am trying to get the MHonArc package to work in conjunction with an in
 house module.
 When MHonArc (http://www.mhonarc.org) is run and told to process a
 single file instead of a directoy full of files, it sends the output to
 STDOUT which inside of mod_perl in this case is the browser.  I am using
 the process_input() function as outlined in the MHonArc mailing list
 archives.
 
 I need to save the output to a variable.

Have you looked into IO::Stringy, and its friends (IO::Scalar,
IO::ScalarArray, IO::Lines)?

perldoc IO::Stringy

NAME
   IO-stringy - I/O on in-core objects like strings and
   arrays

DESCRIPTION
   This toolkit primarily provides modules for performing
   both traditional and object-oriented i/o) on things other
   than normal filehandles; in particular, IO::Scalar,
   IO::ScalarArray, and IO::Lines.
...

An example from perldoc IO::Scalar:

   my $s;
   $SH = IO::Scalar-new(\$s);
   $SH-print("Hel", "lo, "); # OO style...
   print $SH "world!\n";  # ...or non-OO style!

   Causes $s to be set to:

   "Hello, world!\n"

Good luck.

(darren)

-- 
Imagine the Creator as a stand up commedian - and at once the world becomes
explicable.
--H. L. Mencken

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Does mod_perl have anything to do with KeepAlive?

2000-11-28 Thread Larry Leszczynski

Hi All -

 I'm hoping for some enlightenment about how KeepAlive is implemented in
 Apache and whether KeepAlive even comes into play when front-end and
 back-end mod_perl servers communicate with each other via HTTP.

I suppose I shouldn't have started off my previous post with such a
general-sounding comment.  Thanks for all the pointers to the KeepAlive
section in the mod_perl guide, which I have read before and which doesn't
answer the questions I was asking below.

I'll try rephrasing, I'm still hoping for info regarding the questions
that follow:

mod_backhand takes advantage of KeepAlive to speed up communications
between a front-end server and a set a back-end servers that feed data to
the front-end.  I'm trying to figure out how that works and if I can take
advantage of KeepAlive the same way using mod_perl front-end and back-end
servers but without running mod_backhand.

Suppose front-end server A is handling user requests.  In the process of
handling a front-end request, suppose I use LWP or equivalent to make a
HTTP request from A to a back-end server B to get some data that is
needed.  Assuming all the right headers are set for KeepAlive to work
(content length, etc.), can the connection between A and B even take
advantage of KeepAlive for the next time A makes the same request to B?

One problem is that I'm not sure what processes would actually be
"keeping" the ends of the "kept alive" connections.  At each end, would it
be the parent httpd process, or the individual httpd child process that
made/answered the request?

I'm thinking that if A had to fork a CGI that in turn talked to B, the
kept-alive connection would be lost as soon as the CGI process on A died
(socket timeouts notwithstanding).  But what if the request from A to B is
made from within a mod_perl module, or within an Apache::Registry script?

Along the same line of thought (assuming this has made any sense so far),
what happens when you throw ProxyPass/ProxyPassReverse into the mix?  What
(if anything) can be done to take advantage of KeepAlive then?


Thanks,
Larry Leszczynski
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Does mod_perl have anything to do with KeepAlive?

2000-11-28 Thread Stas Bekman

On Tue, 28 Nov 2000, Larry Leszczynski wrote:

 Hi All -
 
  I'm hoping for some enlightenment about how KeepAlive is implemented in
  Apache and whether KeepAlive even comes into play when front-end and
  back-end mod_perl servers communicate with each other via HTTP.
 
 I suppose I shouldn't have started off my previous post with such a
 general-sounding comment.  Thanks for all the pointers to the KeepAlive
 section in the mod_perl guide, which I have read before and which doesn't
 answer the questions I was asking below.
 
 I'll try rephrasing, I'm still hoping for info regarding the questions
 that follow:
 
 mod_backhand takes advantage of KeepAlive to speed up communications
 between a front-end server and a set a back-end servers that feed data to
 the front-end.  I'm trying to figure out how that works and if I can take
 advantage of KeepAlive the same way using mod_perl front-end and back-end
 servers but without running mod_backhand.
 
 Suppose front-end server A is handling user requests.  In the process of
 handling a front-end request, suppose I use LWP or equivalent to make a
 HTTP request from A to a back-end server B to get some data that is
 needed.  Assuming all the right headers are set for KeepAlive to work
 (content length, etc.), can the connection between A and B even take
 advantage of KeepAlive for the next time A makes the same request to B?
 
 One problem is that I'm not sure what processes would actually be
 "keeping" the ends of the "kept alive" connections.  At each end, would it
 be the parent httpd process, or the individual httpd child process that
 made/answered the request?
 
 I'm thinking that if A had to fork a CGI that in turn talked to B, the
 kept-alive connection would be lost as soon as the CGI process on A died
 (socket timeouts notwithstanding).  But what if the request from A to B is
 made from within a mod_perl module, or within an Apache::Registry script?
 
 Along the same line of thought (assuming this has made any sense so far),
 what happens when you throw ProxyPass/ProxyPassReverse into the mix?  What
 (if anything) can be done to take advantage of KeepAlive then?

Before trying to answer your question, let me ask you another
question. What's the average run time of you mod_perl scripts? Is it 2 to
5 msecs? Or is it 0.5 to 1 sec? If you are in the former range this
question makes sense, well may be. If you are in the latter range, you are
wasting your time.

KeepAlive comes to overcome the overhead of initiating connections between
the browser and the server. It's useful when you serve static pages,
because they are delivered in matter of a few milli-seconds. Which is
somewhat comparable with the overhead of creating the connection... or
very fast mod_perl code whose run time comparable to delivery of static
pages (we have simple ads serving at 4-6msec).

KeepAlive helps a lot with SSL connections (https) where the handshake is
a few (4-5?) times slower compared to http, but it's still significant in
the same range of run times.

If your average run time is 10-100 slower than 5 msec, this overhead is
insignificant since it comes down to something like 0.01% of the total
response time over http and probably 0.05% over https.

Now do you still want the KeepAlive?

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




[OT] Mixing C and HTML code just like in ePerl?

2000-11-28 Thread Vladislav Safronov

Hi,

I use ePerl and it's good, but some things need better performance.
Is there any "chtml" compiler that allow me freely mix C and html code
just like in ePerl:


HTML code
%
 C code ..
%
HTML code
%=(C expr.)%
..

Vlad.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




controling POST input with mod_perl

2000-11-28 Thread Alexander Haeckel


Hi there,

I want to control the way a CGI program works by modifying the
parameters passed to it within a FixupHandler. For GET requests
everything works fine. But for POST requests the parameters seem to be
deleted after reading them. If the CGI program is a Perl script I get
the parameters within $r-pnotes to a modified Apache::PerlRun.pm as
PerlHandler to solve the problem. 

How can I get the parameters to a binary CGI program?

Thank you for your help,
Alexander
 
-- 
There never was a good war or a bad peace.
-- B. Franklin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: controling POST input with mod_perl

2000-11-28 Thread Stas Bekman

On 28 Nov 2000, Alexander Haeckel wrote:

 
 Hi there,
 
 I want to control the way a CGI program works by modifying the
 parameters passed to it within a FixupHandler. For GET requests
 everything works fine. But for POST requests the parameters seem to be
 deleted after reading them. If the CGI program is a Perl script I get
 the parameters within $r-pnotes to a modified Apache::PerlRun.pm as
 PerlHandler to solve the problem. 

http://perl.apache.org/guide/snippets.html#Convert_a_POST_Request_into_a_GE
http://perl.apache.org/guide/snippets.html#Redirect_a_POST_Request_Forward
http://perl.apache.org/guide/snippets.html#Reading_POST_Data_then_Redirect

 
 How can I get the parameters to a binary CGI program?
 
 Thank you for your help,
 Alexander
  
 -- 
 There never was a good war or a bad peace.
 -- B. Franklin
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Does mod_perl have anything to do with KeepAlive?

2000-11-28 Thread Matt Sergeant

On Tue, 28 Nov 2000, Larry Leszczynski wrote:

 Suppose front-end server A is handling user requests.  In the process of
 handling a front-end request, suppose I use LWP or equivalent to make a
 HTTP request from A to a back-end server B to get some data that is
 needed.  Assuming all the right headers are set for KeepAlive to work
 (content length, etc.), can the connection between A and B even take
 advantage of KeepAlive for the next time A makes the same request to B?

If you use HTTP::GHTTP, and keep the same request object around in server
memory, you can set the appropriate keepalive headers, and it should
re-use the same connection next time around assuming the keepalive hasn't
timed out.

-- 
Matt/

/||** Director and CTO **
   //||**  AxKit.com Ltd   **  ** XML Application Serving **
  // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** Personal Web Site: http://sergeant.org/ **
 \\//
 //\\
//  \\


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [OT] Mixing C and HTML code just like in ePerl?

2000-11-28 Thread Matt Sergeant

On Tue, 28 Nov 2000, Vladislav Safronov wrote:

 Hi,
 
 I use ePerl and it's good, but some things need better performance.
 Is there any "chtml" compiler that allow me freely mix C and html code
 just like in ePerl:
 
 
 HTML code
 %
  C code ..
 %
 HTML code
 %=(C expr.)%

Inline.pm

But if ePerl is slow then its probably not compiling the script to
Perl. Try something like embperl, or one of the many other solutions.

-- 
Matt/

/||** Director and CTO **
   //||**  AxKit.com Ltd   **  ** XML Application Serving **
  // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** Personal Web Site: http://sergeant.org/ **
 \\//
 //\\
//  \\


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




compiling mod_perl-1.24

2000-11-28 Thread Joseph Crotty

I am on a sun box:

uname -a

SunOS mailroom 5.6 Generic_105181-22 sun4u sparc SUNW,Ultra-5_10

I built and tested both perl 5.6.0 and apache_1.3.9 against gcc and they
check out OK:

gcc -v

Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.7.2.2/specs
gcc version 2.7.2.2

perl -V

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
osname=solaris, osvers=2.6, archname=sun4-solaris
uname='sunos mailroom 5.6 generic_105181-22 sun4u sparc sunw,ultra-5_10
'
config_args='-Dcc=gcc'
hint=previous, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define 
use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
cc='gcc', optimize='-O', gccversion=2.7.2.2
cppflags='-I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64'
ccflags ='-I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib '
libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -lgdbm -ldl -lm -lc -lcrypt -lsec
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: USE_LARGE_FILES
  Built under solaris
  Compiled at Nov 27 2000 16:41:31
  @INC:
/usr/local/lib/perl5/5.6.0/sun4-solaris
/usr/local/lib/perl5/5.6.0
/usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris
/usr/local/lib/perl5/site_perl/5.6.0
/usr/local/lib/perl5/site_perl

So, I run the Makefile as follows:

perl Makefile.PL EVERYTHING=1 APACHE_PREFIX=/usr/local/apache

Configure mod_perl with ../apache_1.3.9/src ? [y] 
Shall I build httpd in ../apache_1.3.9/src for you? [y] 
Appending mod_perl to src/Configuration
Using config file: /home/dvlp/jcrotty/mod_perl-1.24/src/Configuration
Creating Makefile
 + configured for Solaris 260 platform
 + setting C compiler to gcc
 + setting C pre-processor to gcc -E
 + checking for system header files
 + adding selected modules
 + checking sizeof various data types
 + doing sanity check on compiler and options
Creating Makefile in support
Creating Makefile in os/unix
Creating Makefile in ap
Creating Makefile in main
Creating Makefile in lib/expat-lite
Creating Makefile in modules/standard
EXTRA_CFLAGS: -DSOLARIS2=260 -DUSE_EXPAT -I$(SRCDIR)/lib/expat-lite
PerlDispatchHandler.enabled
PerlChildInitHandlerenabled
PerlChildExitHandlerenabled
PerlPostReadRequestHandler..enabled
PerlTransHandlerenabled
PerlHeaderParserHandler.enabled
PerlAccessHandler...enabled
PerlAuthenHandler...enabled
PerlAuthzHandlerenabled
PerlTypeHandler.enabled
PerlFixupHandlerenabled
PerlHandler.enabled
PerlLogHandler..enabled
PerlInitHandler.enabled
PerlCleanupHandler..enabled
PerlRestartHandler..enabled
PerlStackedHandlers.enabled
PerlMethodHandlers..enabled
PerlDirectiveHandlers...enabled
PerlTableApienabled
PerlLogApi..enabled
PerlUriApi..enabled
PerlUtilApi.enabled
PerlFileApi.enabled
PerlConnectionApi...enabled
PerlServerApi...enabled
PerlSectionsenabled
PerlSSI.enabled
Will run tests as User: 'nobody' Group: 'other'
Checking CGI.pm VERSION..ok
Checking for LWP::UserAgent..ok
Checking for HTML::HeadParserok
Writing Makefile for Apache
Writing Makefile for Apache::Connection
Writing Makefile for Apache::Constants
Writing Makefile for Apache::File
Writing Makefile for Apache::Leak
Writing Makefile for Apache::Log
Writing Makefile for Apache::ModuleConfig
Writing Makefile for Apache::PerlRunXS
Writing Makefile for Apache::Server
Writing Makefile for Apache::Symbol
Writing Makefile for Apache::Table
Writing Makefile for Apache::URI
Writing Makefile for Apache::Util
Writing Makefile for mod_perl

I run make and get this:

gcc -c  -I../os/unix -I../include   -DSOLARIS2=260 -DUSE_EXPAT
-I../lib/expat-lite -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64  -I/usr/local/lib/perl5/5.6.0/sun4-solaris/CORE  -I.
-I../.. -DUSE_PERL_SSI -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -DMOD_PERL http_config.c
In file included from /usr/include/sys/vnode.h:41,
 from 

[JOBS] Critical Path

2000-11-28 Thread brian moseley


hi folks. cpth is looking for a couple senior folks to come
in and make immediate contributions on our web groupware
applications team.

the team has several applications that are in the process of
being integrated for a comprehensive user expensive: mail,
personal address book, corporate directory, calendar, fax,
msg boards, secure file services. some of our challenges
include fully internationalizing each product and localizing
to ~20 languages; moving from a handler+Registry
"print-based" architecture to a template architecture
(leaning towards Mason); researching ways to achieve
structured programmatic integration of external
applications; guaranteeing a secure environment for
web-based corporate messaging.

our applications are hosted in a high scale environment and
exist in the context of a large messaging platform; you'll
get the opportunity to work with IMAP, POP, SMTP, LDAP,
ICAP, ICQ, and many other messaging-related protocols, and
possibly b2b applications of SOAP, WebDAV, etc. these is not
your garden variety web-database stuff. opportunities are
also available to work on synchronization tools for Palm,
Outlook etc and extensions for Outlook.

the job req is included below. send inquiries to
[EMAIL PROTECTED] and cc [EMAIL PROTECTED] thanks!

--

Senior Software Developer to work on web-based mail
application and application suite. Be responsible for
development, maintenance and performance of large scale,
cutting edge, hosted applications. Perl5 programming
required, 5+ years software development experience.
Experience with other web application development useful.
Java and C++ experience desirable; knowledge of messaging
systems and protocols useful (IMAP, POP, HTTP, SMTP). Object
oriented design and programming a must. Solaris systems
programming experience needed.

Must have good analytic and communication skills. Must be a
self-starter, capable of diagnosing and solving problems
independently. Must work well in a team environment. Must
have track record of shipping quality products and meeting
time-to-market requirements.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Apache::Request Under Win32?

2000-11-28 Thread Ryan Adams


Excuse me if this is a ridiculous question, but is there any way
to install Apache::Request on a Windows box without VC++?

This is the output from 'perl Makefile.PL' for libapreq:

Warning: Guessing NAME [c] from current directory name.
Usage: xsubpp [-v] [-C++] [-except] [-prototypes] [-noversioncheck]
[-nolinenumb
ers] [-nooptimize] [-noinout] [-noargtypes] [-s pattern] [-typemap
typemap]... f
ile.xs
Writing Makefile for c
Writing Makefile for Apache::Request
Writing Makefile for Apache::Cookie
Writing Makefile for libapreq

When I do an 'nmake install' it gives me a couple of lines like:

Too many parameters - 

And then seems to go on without a problem, but I try to 'use
Apache::Request();'
and it can't find it in @INC.

Does anybody have explicit instructions or prequisites for installing this?

Thanks in advance.

Ryan Adams

PS - I'm not actually trying to use Windows for production mod_perl,
but I want to be able to develop mod_perl stuff for the production
linux box from my laptop when I'm out of the office...


--
Ryan Adams  [EMAIL PROTECTED]
Vitessi Motorsports, Inc.  www.vitessi.com
Voice: 740/362-9254  Fax: 740/362-0354
--


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: compiling mod_perl-1.24

2000-11-28 Thread Lakshmanan, Srikrishnan

I ran into this problem a week ago on both Solaris 2.6 and 2.7 , and I was
using gnu cc 2.7.2.3 . I upgraded to gnu cc 2.95.2 . I had to recompile my
perl 5.6.0 from stable.tar at www.cpan.org using this compiler and rebuilt
Apache and mod_perl without any problems . 

You will find a pre-built binary for gnu cc 2.95.2 at www.sunfreeware.com
for your Solaris version.

Sri Lakshmanan

Koch Petroleum Group
[EMAIL PROTECTED]
"A doctor can bury his mistakes, an architect can only advise his client to
plant vines" -Frank Lloyd Wright


 -Original Message-
 From: Joseph Crotty [SMTP:[EMAIL PROTECTED]]
 Sent: Tuesday,November 28,2000 12:03 PM
 To:   '[EMAIL PROTECTED]'
 Subject:  compiling mod_perl-1.24
 
 I am on a sun box:
 
 uname -a
 
 SunOS mailroom 5.6 Generic_105181-22 sun4u sparc SUNW,Ultra-5_10
 
 I built and tested both perl 5.6.0 and apache_1.3.9 against gcc and they
 check out OK:
 
 gcc -v
 
 Reading specs from
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.7.2.2/specs
 gcc version 2.7.2.2
 
 perl -V
 
 Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
   Platform:
 osname=solaris, osvers=2.6, archname=sun4-solaris
 uname='sunos mailroom 5.6 generic_105181-22 sun4u sparc
 sunw,ultra-5_10
 '
 config_args='-Dcc=gcc'
 hint=previous, useposix=true, d_sigaction=define
 usethreads=undef use5005threads=undef useithreads=undef
 usemultiplicity=undef
 useperlio=undef d_sfio=undef uselargefiles=define 
 use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
   Compiler:
 cc='gcc', optimize='-O', gccversion=2.7.2.2
 cppflags='-I/usr/local/include -D_LARGEFILE_SOURCE
 -D_FILE_OFFSET_BITS=64'
 ccflags ='-I/usr/local/include -D_LARGEFILE_SOURCE
 -D_FILE_OFFSET_BITS=64'
 stdchar='unsigned char', d_stdstdio=define, usevfork=false
 intsize=4, longsize=4, ptrsize=4, doublesize=8
 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
 lseeksize=8
 alignbytes=8, usemymalloc=y, prototype=define
   Linker and Libraries:
 ld='gcc', ldflags =' -L/usr/local/lib '
 libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
 libs=-lsocket -lnsl -lgdbm -ldl -lm -lc -lcrypt -lsec
 libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
   Dynamic Linking:
 dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
 cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'
 
 
 Characteristics of this binary (from libperl): 
   Compile-time options: USE_LARGE_FILES
   Built under solaris
   Compiled at Nov 27 2000 16:41:31
   @INC:
 /usr/local/lib/perl5/5.6.0/sun4-solaris
 /usr/local/lib/perl5/5.6.0
 /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris
 /usr/local/lib/perl5/site_perl/5.6.0
 /usr/local/lib/perl5/site_perl
 
 So, I run the Makefile as follows:
 
 perl Makefile.PL EVERYTHING=1 APACHE_PREFIX=/usr/local/apache
 
 Configure mod_perl with ../apache_1.3.9/src ? [y] 
 Shall I build httpd in ../apache_1.3.9/src for you? [y] 
 Appending mod_perl to src/Configuration
 Using config file: /home/dvlp/jcrotty/mod_perl-1.24/src/Configuration
 Creating Makefile
  + configured for Solaris 260 platform
  + setting C compiler to gcc
  + setting C pre-processor to gcc -E
  + checking for system header files
  + adding selected modules
  + checking sizeof various data types
  + doing sanity check on compiler and options
 Creating Makefile in support
 Creating Makefile in os/unix
 Creating Makefile in ap
 Creating Makefile in main
 Creating Makefile in lib/expat-lite
 Creating Makefile in modules/standard
 EXTRA_CFLAGS: -DSOLARIS2=260 -DUSE_EXPAT -I$(SRCDIR)/lib/expat-lite
 PerlDispatchHandler.enabled
 PerlChildInitHandlerenabled
 PerlChildExitHandlerenabled
 PerlPostReadRequestHandler..enabled
 PerlTransHandlerenabled
 PerlHeaderParserHandler.enabled
 PerlAccessHandler...enabled
 PerlAuthenHandler...enabled
 PerlAuthzHandlerenabled
 PerlTypeHandler.enabled
 PerlFixupHandlerenabled
 PerlHandler.enabled
 PerlLogHandler..enabled
 PerlInitHandler.enabled
 PerlCleanupHandler..enabled
 PerlRestartHandler..enabled
 PerlStackedHandlers.enabled
 PerlMethodHandlers..enabled
 PerlDirectiveHandlers...enabled
 PerlTableApienabled
 PerlLogApi..enabled
 PerlUriApi..enabled
 PerlUtilApi.enabled
 PerlFileApi.enabled
 PerlConnectionApi...enabled
 PerlServerApi...enabled
 PerlSectionsenabled
 PerlSSI.enabled
 Will run tests as User: 'nobody' Group: 'other'
 Checking CGI.pm VERSION..ok
 Checking for LWP::UserAgent..ok
 Checking for HTML::HeadParserok
 Writing Makefile for Apache
 Writing Makefile for 

list digest problems?

2000-11-28 Thread Andrew Dunstan


has the digest software for the mod_perl list changed recently? Here's a
sample of what I've been seeing for a couple of weeks at the top of the
digest:

cheers

andrew






Topics (messages 11320 through 11349):

(null)
11320 by:
11321 by:
11322 by:
11323 by:
11324 by:
11325 by:
11326 by:
11327 by:
11328 by:
11329 by:
11330 by:
11331 by:
11332 by:
11333 by:
11334 by:
11335 by:
11336 by:
11337 by:
11338 by:
11339 by:
11340 by:
11341 by:
11342 by:
11343 by:
11344 by:
11345 by:
11346 by:
11347 by:
11348 by:
11349 by:


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Apache::ASP (QueryString eats +)

2000-11-28 Thread Joshua Chamas

sergen wrote:
 
  When sending text with "+" by "?" on url $Request-QueryString eats
 "+" (the text is absolutely the same but only this sign).
Is it a bug or may be some else ?
 
using: Mandrake 7.2
 Apache 1.3.14-2mdk
apache-mod_perl 1.3.14_1.24-2mdk
Apache-ASP 2.002mdk
httpd-perl (proxied)
 

Apache::ASP doesn't kill the + in a query string when parsing,
but mod_perl might?  Check out what you get in Apache-args
which is where Apache::ASP gets the query string from before
parsing.  You can do a %= Apache-args % in an ASP script.

Apache::ASP does escape + to ' ', space, and if you really want
to have a + in your URL, you will want to escape it with 
$Server-URLEncode($data), or $Server-URL($url, \%params)

--Joshua

_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks  free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Problems on installation...

2000-11-28 Thread don carnage


Hello all -- I recently downloaded apache 1.3.14 and mod perl 1.24 and
received the following error when I tried to run the Makefile.PL:

-
$ perl Makefile.PL APACHE_SRC=../apache_1.3.14/src DO_HTTPD=1 USE_APACI=1
EVERYTHING=1
Will configure via APACI
Enter `q' to stop search
Please tell me where I can find your apache src
 [../apache_x.x/src] ../apache_1.3.14/src
cp apaci/Makefile.libdir ../apache_1.3.14/src/modules/perl/Makefile.libdir
cp apaci/Makefile.tmpl ../apache_1.3.14/src/modules/perl/Makefile.tmpl
cp apaci/README ../apache_1.3.14/src/modules/perl/README
cp apaci/configure ../apache_1.3.14/src/modules/perl/configure
cp apaci/libperl.module ../apache_1.3.14/src/modules/perl/libperl.module
cp apaci/mod_perl.config.sh
../apache_1.3.14/src/modules/perl/mod_perl.config.sh
cp apaci/load_modules.pl.PL
../apache_1.3.14/src/modules/perl/load_modules.pl.PL
cp apaci/find_source.PL ../apache_1.3.14/src/modules/perl/find_source.PL
cp apaci/apxs_cflags.PL ../apache_1.3.14/src/modules/perl/apxs_cflags.PL
cp apaci/mod_perl.exp ../apache_1.3.14/src/modules/perl/mod_perl.exp
* WARNING *

  Apache Version 1.3.0 required, aborting.

* WARNING 
-

Any ideas?

Thanks,
Don


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RFC: DBI::Prof

2000-11-28 Thread Stas Bekman

I have a huge project with lots of tables, and the performance wasn't that
well. So I've started to review the tables definitions and have found that
some indices were missing. I was sick from doing the tracing of all
possible SQL calls manually, so I wrote this simple profiler. Take a look
and tell me if you think it worths releasing on CPAN...

hmm, why mod_perl list... because it works under mod_perl :) In fact I
didn't test it under non mod_perl but it should work as well :)

Anyway, enjoy :)


_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  



package DBI::Prof;

use Apache::Constants qw(DECLINED OK);
use Time::HiRes ();

my %results = ();
my $statement ='';

$DBI::Prof::THRESHOLD = 0.01;

my $sub_execute = \DBI::st::execute;
eval q{
sub DBI::st::execute{
my $start_time = [ Time::HiRes::gettimeofday ];
my $res = $sub_execute;
my $end_time = [ Time::HiRes::gettimeofday ];
my $elapsed = Time::HiRes::tv_interval($start_time,$end_time);
$results{$statement} = $elapsed;
$statement = '';
return $res;
}
};

my $sub_prepare = \DBI::db::prepare;
eval q{
   sub DBI::db::prepare{
   $statement = $_[1];
   $sub_prepare;
   }
   };

sub report{
my $r = shift;
print STDERR "Queries with execute() time  $DBI::Prof::THRESHOLD secs\n";
my $total_time= 0;
my $total_queries = 0;
for (sort {$results{$b} = $results{$a}} keys %results) {
$total_time += $results{$_};
$total_queries++;
next if $results{$_}  $DBI::Prof::THRESHOLD;
print STDERR "$results{$_} $_;\n"
}
print STDERR "Total elapsed execute() time: $total_time\n";
print STDERR "Total number of queries: $total_queries\n\n";
# reset the values
%results = ();
$statement = '';
return OK;
}

1;
__END__

=head1 NAME

DBI::Prof -- Benchmark the $sth-execute() calls to find slow queries and adjust the 
table indices.

=head1 SYNOPSYS

Under normal Perl code:

  use DBI ();
  use DBI::mysql (); # or another driver
  use DBI::Prof ();
  ...your code that queries some DB...
  DBI::Prof::report();

Under mod_perl:

  PerlModule DBI
  PerlModule DBI::mysql #  or another driver
  PerlModule DBI::Prof
  PerlLogHandler DBI::Prof::report

This module must be loaded after CDBD::mysql (or another driver) is
loaded. Not DBI, but the driver, since CDBI::Prof overrides the
execute() and prepare() calls.

=head1 DESCRIPTION

This module allows you to measure the execute() time of all the DBI
queries and thus adjust your code/tables/indices to work faster. It
also reports the total number of queries that were executed and the
total execute() time.

You can modify the C$DBI::Prof::THRESHOLD variable to print only
SQLs which were taken more than C$DBI::Prof::THRESHOLD seconds to
execute. Notice that the measured time is not the exact time that it
took for sql engine to execute the statement, but a little bit higher.

The output goes at the end of each request to the error_log and only
queries that it took longer than C$DBI::Prof::THRESHOLD secs will be
listed, sorted from the longest to the slowest.

I repeat, this is the measurement of the execute() and not
execute()+fetch() which is obviosly longer. So it's mostly useful for
finding queries which don't use indices and therefore very slow.

=head1 AUTHOR

Stas Bekman [EMAIL PROTECTED]

=cut



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Problems on installation...

2000-11-28 Thread ___cliff rayman___

yes - in order to use apache 1.3.14 you need
mod perl 1.24_01 which you can get from here:

http://perl.apache.org/dist/

enjoy,

--
___cliff [EMAIL PROTECTED]http://www.genwax.com/

don carnage wrote:

 Hello all -- I recently downloaded apache 1.3.14 and mod perl 1.24 and
 received the following error when I tried to run the Makefile.PL:

 -
 --snip--
 cp apaci/mod_perl.exp ../apache_1.3.14/src/modules/perl/mod_perl.exp
 * WARNING *

   Apache Version 1.3.0 required, aborting.

 * WARNING 
 -






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Does mod_perl have anything to do with KeepAlive?

2000-11-28 Thread Stas Bekman

On 28 Nov 2000, Joe Schaefer wrote:

 Stas Bekman [EMAIL PROTECTED] writes:
 
  Before trying to answer your question, let me ask you another
  question. What's the average run time of you mod_perl scripts? Is it 2 to
  5 msecs? Or is it 0.5 to 1 sec? If you are in the former range this
  question makes sense, well may be. If you are in the latter range, you are
  wasting your time.
 
 I disagree, naturally ;).  With respect to the effectiveness of keepalives,
 there are many factors that come into play - not least of which are your 
 own site design and consideration of the effects of TCP slow start.  Long
 story short, IMHO there is no way to distill a universal answer for whether 
 one should or should not enable http keepalives.
 
 For the servers I manage, the effect of enabling keepalives on the browser-
 proxy connection is quite significant.  Over DSL connection to a live site
 situated thousands of miles away (20+hops), here's my apachebench stats:
 
 
 % ./ab -n 500 -c 10 http://front.end/proxied/to/backend/content_handler
 
 (The mod_perl content handler here grabs content from a mysql server
 via DBI - it is decidedly non-trivial :)
 
 ...
 
 Document Length:1807 bytes
 
 Concurrency Level:  10
 Time taken for tests:   21.539 seconds
 Complete requests:  500
 Failed requests:0
 Total transferred:  995500 bytes
 HTML transferred:   903500 bytes
 Requests per second:23.21
 Transfer rate:  46.22 kb/s received
 
 Connnection Times (ms)
   min   avg   max
 Connect:   60   129  3064
 Processing:   107   298   250
 Total:167   427  3314
 
 Same URL with keep-alives enabled:
 
 % ./ab -k -n 500 -c 10 http://front.end/proxied/to/backend/content_handler
 
 ...
 
 Document Length:1807 bytes
 
 Concurrency Level:  10
 Time taken for tests:   15.047 seconds
 Complete requests:  500
 Failed requests:0
 Keep-Alive requests:500
 Total transferred:  1014010 bytes
 HTML transferred:   903500 bytes
 Requests per second:33.23
 Transfer rate:  67.39 kb/s received
 
 Connnection Times (ms)
   min   avg   max
 Connect:0 193
 Processing:99   295  2507
 Total: 99   296  2600
 

This is not a real world benchmark. It may generate the real world
load, but not the real world usage. And once you realize that this
cool speedup that you show doesn't really happen.

User requests a single page at a time. The connection is tied to the
browser. User will not issue a new request in the same rate as ab
does. I'd say it takes at least 5-10 secs for user to read the page
and you don't want to keep the mod_perl server tied all this time
doing nothing. Even the front-end server, since you will end up with
thousands of front-end servers if you will use a big KeepAlive.

 Any way you slice it, that is a _huge_ difference!  You just have
 to test the effects yourself to see if it keepalives are worth
 running on your server.

That's true, my point was the same -- check your numbers and see
whether it helps or not. Definitely not with ab or any other benchmark
tool.



_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: RFC: DBI::Prof

2000-11-28 Thread Perrin Harkins

On Tue, 28 Nov 2000, Stas Bekman wrote:
 I have a huge project with lots of tables, and the performance wasn't that
 well. So I've started to review the tables definitions and have found that
 some indices were missing. I was sick from doing the tracing of all
 possible SQL calls manually, so I wrote this simple profiler. Take a look
 and tell me if you think it worths releasing on CPAN...

Try DBIx::Profile.  I've had great success with it.
- Perrin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: RFC: DBI::Prof

2000-11-28 Thread Aaron Ross

On Tue, 28 Nov 2000, Stas wrote:
 possible SQL calls manually, so I wrote this simple profiler. Take a look
 and tell me if you think it worths releasing on CPAN...

Definitely release it! It is a very elegant solution to a problem that I'm 
guessing many of us have dealt with.  I've always _tried_ to write a db
abstraction layer, so this kind of profiling would be easy. But I can easily 
think of two cases where i was trying to track down bad queries and this 
little trick would have saved me a lot of time.

[ couldn't you have telepathically told me how to do this a year ago?? ]

it would be a nice addition to the guide too.

aaron


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Survey Results from Building a ModPerl ISP for you!

2000-11-28 Thread Joshua Chamas

Hey, 

Below are the results of the survey I sent out a couple 
weeks back.  Thanks again for all your responses.

--Joshua

 1. How many dynamic web requests do you serve per month?
  [8] up to 10M pages
  [5] 10M - 100M pages
  [ ] 100M - 1G pages
  [ ] more than 1 gig pages
 
 2. How many servers do you have handling requests, disregarding
network infrastructure.
  [7] 1 - 5
  [ ] 6 - 10
  [2] 11 - 20
  [1] 20 - 50
  [ ] 50+
 
 3. Do you out source ... ( if only willing to in next year, mark with [W] )
  [6] data center facilities like Exodus ( bandwidth, security, 
fire suppression, cooling )
  [1] networking equipment ( LAN routing, switches, firewalls, 
web cluster front ends like alteons, cache servers ) 
  [4] server hardware 
  [ ] server software management
  [1] security ( firewalls, network monitoring, host monitoring )
  [1] backups ( tape, network share, rotating off site storage )
  [ ] file shares ( NFS, Samba space )
  [1] high volume email
  [1] high volume DNS
  [1] network service monitoring
  [ ] geographically distributed DNS
  [1] streaming media, content distribution, like Akamai
  [1] network service load testing
 
 4. What is your web production budget per month?
  [6] up to $5,000
  [1] $5,000 - $10,000
  [ ] $10,000 - $20,000
  [1] $20,000 - $50,000
  [3] over $50,000
 
 5. Which web deployment issues are most important to your business?
  [7] cost
  [7] scalability
  [5] fault tolerance, over 99.99% uptime
  [2] time to market
  [1] physical access to hardware  data
  [3] network engineering expertise
  [4] web engineering expertise
 
 6. Would you be willing to out source the above services to facilities in:
  [5] Los Angeles, CA
  [5] San Francisco, CA
  [5] San Diego, CA
  [7] New York, NY
  [5] Austin, TX
  [5] Seattle, WA
  [4] London
  [5] Amsterdam
  [1] Paris
 Also, 1 for Pittsburg
 7. What OS's do you run in web production?
  [12] Linux
  [2] Solaris
  [1] WinNT / Win2000
  [3] *BSD
  [ ] Other
  [3] Could you switch?
   
 8. Are you currently a ...
  [10] Engineer / Sysadmin / Developer
  [4] Manager
  [4] Consultant
 
 9. What databases are you using?
  [9] MySQL
  [3] Oracle
  [2] Sybase
  [4] PostgreSQL
  [1] Informix
  [ ] DB2
  [3] Could you switch?
 
 10. What does your database require:
  [10] Speed
  [4] Transactions
  [4] Clustering / Fault Tolerance
  [5] Clustering / Scalability
  [3] Database logic, i.e. triggers, procedures
  [2] Database integrity, i.e. referential constraints
 
 11. What are your web development languages?  
  [12] Perl
  [2] Java
  [2] C/C++
  [ ] Python
  [ ] Other


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Apache::Request Under Win32?

2000-11-28 Thread Randy Kobes

On Tue, 28 Nov 2000, Ryan Adams wrote:

 
 Excuse me if this is a ridiculous question, but is there any way
 to install Apache::Request on a Windows box without VC++?
[ ... ]

Hi,
No - it requires a C compiler ... Even with VC++, though,
some changes to the distribution are needed to get it to compile;
if you're interested, drop me a note off-line, and I'll send
you the patches I used. However, if you're just interested in trying
it out, I made up a libapreq ppm package for use with
ActivePerl (builds 6xx) - you can get it from
   http://theoryx5.uwinnipeg.ca/ppmpackages/

best regards,
randy kobes


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Does mod_perl have anything to do with KeepAlive?

2000-11-28 Thread Joe Schaefer

Stas Bekman [EMAIL PROTECTED] writes:

 This is not a real world benchmark. It may generate the real world
 load, but not the real world usage. And once you realize that this
 cool speedup that you show doesn't really happen.
 

Of course not- I only posted those results to show that under certain
real conditions, it can make a real difference.  Often times a single
url will contain links to 20+ url's on the same server (many of them
304's). If you have keepalives enabled (even if only for 1 or 2 sec's), 
the page loading wait is often noticable for modem users.

In my particular line of work, any excess latency is intolerable.  
My customers want almost instantaneous page loads, so my servers 
are built to accomodate them.  Heavy server loads are not of 
paramount concern.

I'm sure that is quite different from what your needs are, and 
that's my point. It all depends.

 
 That's true, my point was the same -- check your numbers and see
 whether it helps or not. Definitely not with ab or any other benchmark
 tool.
 

Nothing wrong with ab - just know it's limitations (or how to make it
say what you want ;).

-- 
Joe Schaefer


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Does mod_perl have anything to do with KeepAlive?

2000-11-28 Thread Stas Bekman

On 28 Nov 2000, Joe Schaefer wrote:

 Stas Bekman [EMAIL PROTECTED] writes:
 
  This is not a real world benchmark. It may generate the real world
  load, but not the real world usage. And once you realize that this
  cool speedup that you show doesn't really happen.
  
 
 Of course not- I only posted those results to show that under certain
 real conditions, it can make a real difference.  Often times a single
 url will contain links to 20+ url's on the same server (many of them
 304's). If you have keepalives enabled (even if only for 1 or 2 sec's), 
 the page loading wait is often noticable for modem users.
 
 In my particular line of work, any excess latency is intolerable.  
 My customers want almost instantaneous page loads, so my servers 
 are built to accomodate them.  Heavy server loads are not of 
 paramount concern.
 
 I'm sure that is quite different from what your needs are, and 
 that's my point. It all depends.

  That's true, my point was the same -- check your numbers and see
  whether it helps or not. Definitely not with ab or any other benchmark
  tool.
  
 
 Nothing wrong with ab - just know it's limitations (or how to make it
 say what you want ;).

Joe, I agree with you absolutely. Each one has to evaluate his own
situation and configure things based on the requirement.

I just wanted to make sure that folks won't jump on the wrong conclusion
based on your specific case benchmark to run and enable the KeepAlive on
their machine, which in the average case will sky rocket the memory usage
as the number of tied processes will go up.

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: RFC: DBI::Prof

2000-11-28 Thread Stas Bekman

 On Tue, 28 Nov 2000, Stas Bekman wrote:
  I have a huge project with lots of tables, and the performance wasn't that
  well. So I've started to review the tables definitions and have found that
  some indices were missing. I was sick from doing the tracing of all
  possible SQL calls manually, so I wrote this simple profiler. Take a look
  and tell me if you think it worths releasing on CPAN...
 
 Try DBIx::Profile.  I've had great success with it.

Ouch, I was checking the wrong namespace DBI:: and that's why I've missed
it. Why DBIx? 

Looks like it does pretty much the same but returns too much info, which
makes it quite hard to use when you have 100+ queries in some requests :)
And fetch()es are quite irrelevant for performance improvements since they
never change unless you compare TCP/IP vs UNIX sockets or one driver
against the other. My aim was to have one to tune the code when I'm in a
given environment...

The only problem with DBIx::Profile is that you have to turn Apache::DBI
off, since DBIx::Profile overrides disconnect() as well.

I suppose if it's still desirable for my hack to go in, it should be at
least ProfSimple or ProfQuickDirty :) I also think that it should go into
DBI:: tree, since it doesn't use the framework of DBIx:: classes. Or is
there any reason for not using DBI::?

Thanks!

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




efficient mod_perl alternatives to fork()?

2000-11-28 Thread Paul

Hi all.

I'm writing module code which (for backward compatibility with the CGI
it's replacing) needs to be able to execute commands from a file.
(~urgh~) The files have usually been ksh and/or Perl. Commonly, they
contain a directive to execute a line of shell script.

Ideally, such commands will be replaced with equivelent perl code which
could simply be eval()'d, but I'm concerned that one of my coworkers
might write his perl code with backticks in it (like `grep foo *.bar`)
instead of writing the few extra lines of code, particularly since we
have a lot of legacy code in several languages (such as ksh functions).

Wouldn't that effectively fork an entire server process before exec'ing
the qx//? And is there any simple way to prevent that, or any simple
alternative aside from a big stick? 

(a stoopid question -- Doesn't a Perl eval() with backticks do a full
blown program fork and exec, too?)

Also, I realize the security holes this might present, but the files in
question are never influenced by user input. Security isn't the
question -- just the fork.

Thanks a mil,
Paul

__
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: RFC: DBI::Prof

2000-11-28 Thread Matt Sergeant

On Tue, 28 Nov 2000, Stas Bekman wrote:

 Or is there any reason for not using DBI::?

Tim mandates it. DBI:: is reserved for DBI only. DBD::* is reserved for
DBD drivers only, anything else goes in DBIx.

-- 
Matt/

/||** Director and CTO **
   //||**  AxKit.com Ltd   **  ** XML Application Serving **
  // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** Personal Web Site: http://sergeant.org/ **
 \\//
 //\\
//  \\


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: efficient mod_perl alternatives to fork()?

2000-11-28 Thread Mike Janson


You don't mention which OS you're using, but in Richard Stevens'
_Advanced Programming in the UNIX Environment_, on p.189 he states:

"Many current implementations don't perform a complete copy of the 
parent's data, stack, and heap, since a fork is often followed by an 
exec.  Instead, a technique called copy-on-write (COW) is used."

This does exactly what you'd think it would--shared heap is made 
read-only, and additional memory is allocated only when the parent or 
child try to modify data.

So, forking an entire server process isn't as bad as you'd think.

-Mike


At 1:39 PM -0800 11/28/00, Paul wrote:
Hi all.

I'm writing module code which (for backward compatibility with the CGI
it's replacing) needs to be able to execute commands from a file.
(~urgh~) The files have usually been ksh and/or Perl. Commonly, they
contain a directive to execute a line of shell script.

Ideally, such commands will be replaced with equivelent perl code which
could simply be eval()'d, but I'm concerned that one of my coworkers
might write his perl code with backticks in it (like `grep foo *.bar`)
instead of writing the few extra lines of code, particularly since we
have a lot of legacy code in several languages (such as ksh functions).

Wouldn't that effectively fork an entire server process before exec'ing
the qx//? And is there any simple way to prevent that, or any simple
alternative aside from a big stick?

(a stoopid question -- Doesn't a Perl eval() with backticks do a full
blown program fork and exec, too?)

Also, I realize the security holes this might present, but the files in
question are never influenced by user input. Security isn't the
question -- just the fork.

Thanks a mil,
Paul

__
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




DBI Problem

2000-11-28 Thread Bob Foster

Hi Folks,

Everything is working great but I can't make a connection to my Oracle database (which 
is on another server) using mod_perl.

-Perl 5.005_03 is working great.
-mod_perl 1.24_01 is working great with apache 1.3.14
-DBI 1.14 connections are working great with DBD Oracle 1.06

I can connect to test.cgi and produce the output with 
Options +ExecCGI 
SetHandler cgi-script.

But when I use:
Options +ExecCGI 
SetHandler perl-script 
PerlHandler Apache::Registry 
I get no error message in the error_log, and a simple "The page cannot be displayed" 
in the browser.

I know that test.cgi is being found since I have a 'warn' message in it which gets 
sent to the error_log.

HELP, Please,  I've been working on this for days and have run out of ideas!

Thanks!  

Bob

P.S.  test.cgi follows:

#!/usr/local/bin/perl  
use strict;
use DBI;
warn "hello!";
use CGI qw(:standard);
my $query = new CGI;
my $dbh = DBI-connect( 'dbi:Oracle:GEORGE',
'userid',
'passwork',
{
  RaiseError = 1,
  AutoCommit = 0
}
  ) || die "Database connection not made: $DBI::errstr";

my $sql = qq{ select survey_set_id, pub_id, start_date, end_date from survey_set};
my $sth = $dbh-prepare( $sql );
$sth-execute();

my( $id, $pub_id, $start, $end );
$sth-bind_columns( undef, \$id, \$pub_id, \$start, \$end );

print $query-header;
while( $sth-fetch() ) {
  print "$pub_id, $start, $end\n\n";
}

$sth-finish();

$dbh-disconnect();




Re: RFC: DBI::Prof

2000-11-28 Thread Fabrice Scemama

It would be nice if Tim Bunce simply added it as a parameter
to DBI's existing methods. Why not ask him?

Fabrice

Aaron Ross wrote:
 
 On Tue, 28 Nov 2000, Stas wrote:
  possible SQL calls manually, so I wrote this simple profiler. Take a look
  and tell me if you think it worths releasing on CPAN...
 
 Definitely release it! It is a very elegant solution to a problem that I'm
 guessing many of us have dealt with.  I've always _tried_ to write a db
 abstraction layer, so this kind of profiling would be easy. But I can easily
 think of two cases where i was trying to track down bad queries and this
 little trick would have saved me a lot of time.
 
 [ couldn't you have telepathically told me how to do this a year ago?? ]
 
 it would be a nice addition to the guide too.
 
 aaron

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: RFC: DBI::Prof

2000-11-28 Thread Matt Sergeant

On Wed, 29 Nov 2000, Fabrice Scemama wrote:

 It would be nice if Tim Bunce simply added it as a parameter
 to DBI's existing methods. Why not ask him?

I think most people would prefer to see it as a separate module. Generally
people do their query optimisations outside of DBI (and Perl), using the
database's in-built profilers.

-- 
Matt/

/||** Director and CTO **
   //||**  AxKit.com Ltd   **  ** XML Application Serving **
  // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** Personal Web Site: http://sergeant.org/ **
 \\//
 //\\
//  \\


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: RFC: DBI::Prof

2000-11-28 Thread Perrin Harkins

On Tue, 28 Nov 2000, Stas Bekman wrote:
 Looks like it does pretty much the same but returns too much info, which
 makes it quite hard to use when you have 100+ queries in some requests :)

I suspect it would be pretty easy to add in a threshold like the one in
your module.

 And fetch()es are quite irrelevant for performance improvements since they
 never change unless you compare TCP/IP vs UNIX sockets or one driver
 against the other.

I find the fetch information useful when deciding whether to do a more
complex query that retrieves fewer results or a simple one that retrieves
extra data and then sift through it in perl.

You could probably modify DBIx::Profile to support a flag for turning this
off.

 The only problem with DBIx::Profile is that you have to turn Apache::DBI
 off, since DBIx::Profile overrides disconnect() as well.

I didn't turn Apache::DBI off and things still seemed to work.

- Perrin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: RFC: DBI::Prof

2000-11-28 Thread Stas Bekman

On Tue, 28 Nov 2000, Matt Sergeant wrote:

 On Wed, 29 Nov 2000, Fabrice Scemama wrote:
 
  It would be nice if Tim Bunce simply added it as a parameter
  to DBI's existing methods. Why not ask him?
 
 I think most people would prefer to see it as a separate module. Generally
 people do their query optimisations outside of DBI (and Perl), using the
 database's in-built profilers.

This one is not about optimizing the database, but finding the missing
indices mostly and seeing which queries might need to be rewritten to make
a better use of the driver/db. I don't know how can you do that without
actually running your application, which means DBI/Perl.

I suppose that if someone will send a necessary patch to Tim he might put
it in or not... I'm fine with any of Tim's decisions. 

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Apache::MP3 Problem?

2000-11-28 Thread Sean Keplinger


The Apache::MP3 module allows you to stream MP3 files from your webserver --
it's a pretty spiffy little interface. Everything appears to be working
fine, but when I try to stream an MP3, I get the following error in my
error_log:

[Tue Nov 28 20:01:54 2000] [error] [client x.x.x.x] need AuthName:
/mp3/songname.m3u

Is it requesting that I set up a .htaccess file for that directory, or is
something potentially misconfigured in the Location directive?

My access.conf is as follows:

Location /mp3

   SetHandler perl-script
   PerlHandler Apache::MP3::Sorted

   PerlSetVar  SortFieldsAlbum,Title,-Duration
   PerlSetVar  FieldsTitle,Artist,Album,Duration
   PerlSetVar  CacheDir   /usr/tmp/mp3_cache

   Order deny,allow
   Allow from All

/Location


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Should I use CGI.pm?

2000-11-28 Thread quagly


I am working my way through the eagle book.  I have not used CGI.pm
before.  It is used in many (most?) of the examples.  

Is it worth learning to use it?  

I am not clear whether the authors are using it because the think it is
the best way to go, or because they already know it ( or created it )and
it is convenient.  

I have not done CGI programming before, but have some experience with
java servlets.  It there a compelling reason I should learn it ( other
than that it would help me to understand the book? )

Thanks,
~quagly

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: efficient mod_perl alternatives to fork()?

2000-11-28 Thread Ken Williams

[EMAIL PROTECTED] (Paul) wrote:
I'm writing module code which (for backward compatibility with the CGI
it's replacing) needs to be able to execute commands from a file.
(~urgh~) The files have usually been ksh and/or Perl. Commonly, they
contain a directive to execute a line of shell script.

Ideally, such commands will be replaced with equivelent perl code which
could simply be eval()'d, but I'm concerned that one of my coworkers
might write his perl code with backticks in it (like `grep foo *.bar`)
instead of writing the few extra lines of code, particularly since we
have a lot of legacy code in several languages (such as ksh functions).

Wouldn't that effectively fork an entire server process before exec'ing
the qx//? And is there any simple way to prevent that, or any simple
alternative aside from a big stick? 

(a stoopid question -- Doesn't a Perl eval() with backticks do a full
blown program fork and exec, too?)

No, eval() runs the code through the Perl interpreter in the same
process, with full access to any variables that exist in the current
scope.

Any code run by eval() can, of course, fork, use backticks, run system
calls, or do any number of other things that spawn sub-processes.  But
the eval() itself doesn't.

See also
http://perl.apache.org/guide/performance.html#Forking_and_Executing_Subprocess


  ------
  Ken Williams Last Bastion of Euclidity
  [EMAIL PROTECTED]The Math Forum

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Should I use CGI.pm?

2000-11-28 Thread Peter J. Schoenster

On 28 Nov 2000, at 18:54, quagly wrote:

  I am working my way through the eagle book.  I have not used CGI.pm
 before.  It is used in many (most?) of the examples.  
 
 Is it worth learning to use it?  
 
 I am not clear whether the authors are using it because the think it
 is the best way to go, or because they already know it ( or created it
 )and it is convenient.  
 
 I have not done CGI programming before, but have some experience with
 java servlets.  It there a compelling reason I should learn it ( other
 than that it would help me to understand the book? )

I have long used CGI.pm but I never used most of its functions  The 
following module supplies me with everything I got from CGI.pm:

http://search.cpan.org/doc/GEOFF/Apache-
RequestNotes_0.05/RequestNotes.pm

It really gives me the essence (form values in a hash) of what I 
need ... it gives more but I haven't been there yet.

I'd suggest using a template system. My favorite (easily spans 
plain cgi to modperl and is very easy for designers to understand) 
is:

http://search.cpan.org/doc/SAMTREGAR/HTML-Template-
2.0/Template.pm

There are plenty more and I believe there was recent discussion (or 
periodic).

Also, search the archives, there has been periodic talk about this. I 
use these archives but there are others:

http://www.geocrawler.com/lists/3/Web/182/0/

Peter

---
"Reality is that which, when you stop believing in it, doesn't go
away".
-- Philip K. Dick

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




1.24 to 1.24_01 spinning httpds on startup (solved)

2000-11-28 Thread Michael J Schout

About a month or 2 ago, I had posted a problem where I tried to upgrade from:

Redhat Linux 6.2,
perl 5.6.0
Apache 1.3.12
mod_perl 1.24
mod_ssl 2.6.6

to 

Redhat Linux 6.2
perl 5.6.0
Apache 1.3.14
mod_perl 1.24_01
mod_ssl 2.7.1

And reported that after doing this, my httpds would spin on startup.  When I
turned on MOD_PERL_TRACE=all, it was showing that it was stuck in an infinite
loop processing configuration stuff.  I posted the mod_perl trace for it as
well.

I have finally gotten a chance to revisit this and it turns out that what was
causing problems was that I had in my httpd.conf:

Perl
$PerlRequire = '/some/path/file.pl';
/Perl

Changing this to:

Perl
push @PerlRequire, '/some/path/file.pl';
/Perl

Fixed the problem under 1.24_01 for me and everything appears to be kosher now.

Maybe the behavior of PerlRequire has changed between 1.24 and 1.24_01?  

Anyways, I wanted to post this to the list in hopes that this might help others
who may have stumbled onto this problem.

Regards,
Mike



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Apache::SSI design questions

2000-11-28 Thread Ken Williams

Hi,

A recent set of patches sent to me for Apache::SSI left me wondering
about a couple of design issues, so I thought I'd turn to the list.

1) Is it preferred to use POSIX::strftime() for time formatting, or
   Date::Format::strftime()?  One solution would be to dynamically load one
   or the other module according to which one is available, but I'd rather
   not do that.

2) One can use if, elif, exec, perl, and probably other directives to
   bring Perl's capabilities into SSI.  Currently I don't check INCNOEXEC to
   make sure that the configuration allows such things (it's not even clear
   that this is the correct flag to check anyway).  Nor do I even check
   INCLUDES in the first place.  Do people care about these things?  They
   seem to me like a bit of a flimsy defense against an uncommon enemy, but
   perhaps people are relying on them.


  ------
  Ken Williams Last Bastion of Euclidity
  [EMAIL PROTECTED]The Math Forum

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: RFC: DBI::Prof

2000-11-28 Thread Henrik Tougaard

 From: Perrin Harkins [mailto:[EMAIL PROTECTED]]
 On Tue, 28 Nov 2000, Stas Bekman wrote:
  And fetch()es are quite irrelevant for performance 
 improvements since they
  never change unless you compare TCP/IP vs UNIX sockets or one driver
  against the other.
 
 I find the fetch information useful when deciding whether to do a more
 complex query that retrieves fewer results or a simple one 
 that retrieves
 extra data and then sift through it in perl.

For some drivers (DBD::Ingres for one) the $sth-execute only optimizes the
query, the data is fetched in the first call to fetch. Fetching the first
row does all the "real" work, joining and sorting etc. 
So you will se a very fast prepare time, a not-too-long execute time, and
(in some cases) a horribly long fetch-time for the first fetch.

--
Henrik Tougaard, [EMAIL PROTECTED]
DBD::Ingres maintainer.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]