RE: Highly optimized mod_perl ?

2000-06-26 Thread Vladislav Safronov

Ok !

 -Original Message-
 From: Stas Bekman [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 23, 2000 2:02 PM
 To: Vladislav Safronov
 Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
 Subject: RE: Highly optimized mod_perl ?
 
 
  Hi, ( ili privet )
  
  I was looking any tips and tricks to optimize my perl script since,
  our sysadm tells that it's mod_perl slow down the web server
  response time and it should be rewritten in C. This script
  does use any database connection, so I think threre is no 
 real way to
  speed it up. Posting message here was the last chance.
  
  Vlad.
  
  pishite po-russki.
 
 Vlad, this is an international list, so please refrain from 
 using other
 languages than English. It's impolite to speak in the 
 languages that your
 audience doesn't know, even if some of the people do. 
 Especially if you
 are seeking help.
 
 For performance notes see: 
 http://perl.apache.org/guide/performance.html
 
  
   -Original Message-
   From: [EMAIL PROTECTED] 
   [mailto:[EMAIL PROTECTED]]On Behalf Of [EMAIL PROTECTED]
   Sent: Saturday, June 17, 2000 9:24 PM
   To: Vladislav Safronov
   Cc: [EMAIL PROTECTED]
   Subject: RE: Highly optimized mod_perl ?
   
   
   Hi,
   
   There was a discussion on this list about
   1.5 weeks ago on how to optimize mod_perl
   execution when using the database.  Stas
   Bekman basically has done some tests to
   show that the driver needs to be initialized
   in startup.pl file.
   
   There were also a discussion about the fact
   that as far as using templates for HTML
   generation the fastest approach is when
   a template is compiled into perl code
   before being executed.  I do not have
   enough understanding of the internals to 
   explain why though.
   
   Another discussion suggested that it is
   much better to precompile explicitly
   the functions that you need to use
   in modules like CGI.pm instead.  The
   fact that you precompile specific functions
   and not the whole module will save memory
   space of apache processes that run mod_perl.
   Saved memory means less swaping, and more
   memory for cache -- that means speed.
   
   There was also a post referring to a comparasing
   between many scripting and compiled languages
   that pointed out that by far the most
   important factor when choosing a language
   to implement a taks is what algorithm is
   being used (ie. how smart and fast it is)
   and that differences in programming languages
   are not significant compared to that.
   
   I also just recently read in "Advanced Perl Programming"
   by Sriram Srinivasan that (on page 369)
   there are Static Typing Hints:
   they give hints to the interepreter for better 
 optimization
   and type checking.
   so 
   my Dog $spot = new Dog;
   should be faster
   then 
   my $spot= new Dog;
   
   It actually should be faster for the consequent method calls
   to $spot-xyz (because perl would not have to do type checking
   and run-time)
   (this me parapharsing the example from the book
   
   Static hints will also allow for more aggressive compiler 
   optimizations
   (using perlcc) (but I do thing this mod_perl relevant).
   
   This is my high level overview of what I have learned sofar
   from the list (I am new to Perl so I am just trying to absorb
   as much as possible).
   
   Regards,
   Vladislav P.
   
   
   
   
   
   
   On 17-Jun-2000 Vladislav Safronov wrote:
Hi!

Does anyone know the way to highly optimize mod_perl for speed?
Any hacks, advices? All standard advices read from help 
 are done...

Best regards,

Vlad Safronov,
mailto: [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://perl.org http://stason.org/TULARC
 http://singlesheaven.com http://perlmonth.com http://sourcegarden.org
 
 



RE: Highly optimized mod_perl ?

2000-06-23 Thread pvlad

Well, with little knowledge I have about mod_perl

if sys admin tells you that mod_perl slows down
the system, before making changes to the program
you should have at least the following:

a) Memory utilization numbers (sorted by a process)
b) CPU utilization numbers (sorted by a process)
c) Whether there is any process locks any file for more then a second
d) If you access the dabase you need statics for what
the db engine is doing
e) you also need to know whether the network requests that your
   program makes are being handled immediately by other servers
f) you should profile your application and see if the numbers
   from the profile correlate to overall system utilization statistics
   that you obtained in steps above.
g) you should also be able to determine things like:
   how often perl has to recompile a module.  Are you regular expressions
   being evaluated every time when executed.


Once you get all that information, this list may be able to help
you in deciding what and how to optimize.  
Performance tuning is a science on its own (a little one :-) ) and
there are a lot of details to be considered there.

Regards,
Vladislav

 


On 23-Jun-2000 Vladislav Safronov wrote:
 Hi, ( ili privet )
 
 I was looking any tips and tricks to optimize my perl script since,
 our sysadm tells that it's mod_perl slow down the web server
 response time and it should be rewritten in C. This script
 does use any database connection, so I think threre is no real way to
 speed it up. Posting message here was the last chance.
 
 Vlad.
 
 pishite po-russki.
 
 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED]]On Behalf Of [EMAIL PROTECTED]
 Sent: Saturday, June 17, 2000 9:24 PM
 To: Vladislav Safronov
 Cc: [EMAIL PROTECTED]
 Subject: RE: Highly optimized mod_perl ?
 
 
 Hi,
 
 There was a discussion on this list about
 1.5 weeks ago on how to optimize mod_perl
 execution when using the database.  Stas
 Bekman basically has done some tests to
 show that the driver needs to be initialized
 in startup.pl file.
 
 There were also a discussion about the fact
 that as far as using templates for HTML
 generation the fastest approach is when
 a template is compiled into perl code
 before being executed.  I do not have
 enough understanding of the internals to 
 explain why though.
 
 Another discussion suggested that it is
 much better to precompile explicitly
 the functions that you need to use
 in modules like CGI.pm instead.  The
 fact that you precompile specific functions
 and not the whole module will save memory
 space of apache processes that run mod_perl.
 Saved memory means less swaping, and more
 memory for cache -- that means speed.
 
 There was also a post referring to a comparasing
 between many scripting and compiled languages
 that pointed out that by far the most
 important factor when choosing a language
 to implement a taks is what algorithm is
 being used (ie. how smart and fast it is)
 and that differences in programming languages
 are not significant compared to that.
 
 I also just recently read in "Advanced Perl Programming"
 by Sriram Srinivasan that (on page 369)
 there are Static Typing Hints:
 they give hints to the interepreter for better optimization
 and type checking.
 so 
 my Dog $spot = new Dog;
 should be faster
 then 
 my $spot= new Dog;
 
 It actually should be faster for the consequent method calls
 to $spot-xyz (because perl would not have to do type checking
 and run-time)
 (this me parapharsing the example from the book
 
 Static hints will also allow for more aggressive compiler 
 optimizations
 (using perlcc) (but I do thing this mod_perl relevant).
 
 This is my high level overview of what I have learned sofar
 from the list (I am new to Perl so I am just trying to absorb
 as much as possible).
 
 Regards,
 Vladislav P.
 
 
 
 
 
 
 On 17-Jun-2000 Vladislav Safronov wrote:
  Hi!
  
  Does anyone know the way to highly optimize mod_perl for speed?
  Any hacks, advices? All standard advices read from help are done...
  
  Best regards,
  
  Vlad Safronov,
  mailto: [EMAIL PROTECTED] 
 




Highly optimized mod_perl ?

2000-06-17 Thread Vladislav Safronov

Hi!

Does anyone know the way to highly optimize mod_perl for speed?
Any hacks, advices? All standard advices read from help are done...

Best regards,

Vlad Safronov,
mailto: [EMAIL PROTECTED] 



RE: Highly optimized mod_perl ?

2000-06-17 Thread pvlad

Hi,

There was a discussion on this list about
1.5 weeks ago on how to optimize mod_perl
execution when using the database.  Stas
Bekman basically has done some tests to
show that the driver needs to be initialized
in startup.pl file.

There were also a discussion about the fact
that as far as using templates for HTML
generation the fastest approach is when
a template is compiled into perl code
before being executed.  I do not have
enough understanding of the internals to 
explain why though.

Another discussion suggested that it is
much better to precompile explicitly
the functions that you need to use
in modules like CGI.pm instead.  The
fact that you precompile specific functions
and not the whole module will save memory
space of apache processes that run mod_perl.
Saved memory means less swaping, and more
memory for cache -- that means speed.

There was also a post referring to a comparasing
between many scripting and compiled languages
that pointed out that by far the most
important factor when choosing a language
to implement a taks is what algorithm is
being used (ie. how smart and fast it is)
and that differences in programming languages
are not significant compared to that.

I also just recently read in "Advanced Perl Programming"
by Sriram Srinivasan that (on page 369)
there are Static Typing Hints:
they give hints to the interepreter for better optimization
and type checking.
so 
my Dog $spot = new Dog;
should be faster
then 
my $spot= new Dog;

It actually should be faster for the consequent method calls
to $spot-xyz (because perl would not have to do type checking
and run-time)
(this me parapharsing the example from the book

Static hints will also allow for more aggressive compiler optimizations
(using perlcc) (but I do thing this mod_perl relevant).

This is my high level overview of what I have learned sofar
from the list (I am new to Perl so I am just trying to absorb
as much as possible).

Regards,
Vladislav P.






On 17-Jun-2000 Vladislav Safronov wrote:
 Hi!
 
 Does anyone know the way to highly optimize mod_perl for speed?
 Any hacks, advices? All standard advices read from help are done...
 
 Best regards,
 
 Vlad Safronov,
 mailto: [EMAIL PROTECTED] 




Re: Highly optimized mod_perl ?

2000-06-17 Thread Perrin Harkins

Vladislav Safronov wrote:
 Does anyone know the way to highly optimize mod_perl for speed?
 Any hacks, advices? All standard advices read from help are done...

The Guide (http://perl.apache.org/guide/) is very comprehensive.  If
you've followed the perfromance tuning tips there, the main thing left
is improving the speed of your database or other data access.  Use
Apache::DProf to find out where it hurts.
- Perrin



RE: Highly optimized mod_perl ?

2000-06-17 Thread G.W. Haywood

Hi there,

On Sat, 17 Jun 2000 [EMAIL PROTECTED] wrote:

 Saved memory means less swaping,

You don't want _any_ swapping on a mod_perl host.

73,
Ged.




RE: Highly optimized mod_perl ?

2000-06-17 Thread pvlad

Yes, you are right.
I should have just said
'saves memory' -- most developers
realize the implications of improved
memory utilization.

Vladislav.

On 17-Jun-2000 G.W. Haywood wrote:
 Hi there,
 
 On Sat, 17 Jun 2000 [EMAIL PROTECTED] wrote:
 
 Saved memory means less swaping,
 
 You don't want _any_ swapping on a mod_perl host.
 
 73,
 Ged.