Re: speed limit

2007-08-17 Thread Perrin Harkins
On 8/16/07, Jen mlists [EMAIL PROTECTED] wrote:
 Is it possible to write speed limit module (for file downloading) by
 modperl rather than using Apache's official module?

Yes, you have the full Apache API available to you from mod_perl.  If
you look on CPAN, you may find something like this already.

- Perrin


Re: speed

2005-08-22 Thread Randy Kobes

On Sat, 20 Aug 2005, Octavian Rasnita wrote:


Hi,

I have made a site using mod_perl with ModPerl::Registry.

It works much faster than using a simple cgi script, but 
it still works slow sometimes and I would like to change 
some things.


There are 3 situations:

1. The page is displayed pretty fast (less than a second)

2. The same kind of page is displayed very slow (more than 20 seconds)

3. The same kind of page, sometimes is still Opening 
page... for tens of seconds, and after that appears a 404 
Not Found error. If I refresh that page immediately after 
that, it is displayed very fast with no problem.


Please tell me how I can test:

- Why that 404 error appears

- Why sometimes it takes so long to display the same kind 
of page other times displays much faster


- How can I test where the script hangs, which part of the 
script is so slow


I assume, for the delay problem, you've ruled out 
correlations with a (momentary) high server load?


Does the script involve a database connection that
may sometimes be a bottleneck?

Does anything useful appear in the error log? The Apache 
ab program may be useful in this regard.


At least for linux, the Apache::DB module (see especially
Apache::SmallProf) may help in tracking down where the
script is spending most of its time.

If these don't help, can you post a minimal script, and
configuration, which illustrates the problem?

--
best regards,
randy kobes


Re: speed

2005-08-22 Thread Philip M. Gollucci

Randy Kobes wrote:

At least for linux, the Apache::DB module (see especially
Apache::SmallProf) may help in tracking down where the
script is spending most of its time.

Actually, I'm thiking you mean Apache::DProf just make sure you look it EARLY 
enough
as Perrin has said before to other posters.

--
END

What doesn't kill us can only make us stronger.
Nothing is impossible.

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
  http://www.liquidityservicesinc.com
   http://www.liquidation.com
   http://www.uksurplus.com
   http://www.govliquidation.com
   http://www.gowholesale.com



Re: speed

2005-08-22 Thread Octavian Rasnita
From: Randy Kobes [EMAIL PROTECTED]
Subject: Re: speed



 I assume, for the delay problem, you've ruled out
 correlations with a (momentary) high server load?


No. Unfortunately not. The server has no load, because it is a test server
and I am the only user.
It works locally, so the internet connection speed is not an issue either.

 Does the script involve a database connection that
 may sometimes be a bottleneck?


Yes it involves a MySQL connection, but that MySQL database and that server
is not used by someone else so I don't understand why some pages show so
fast while others so slow.

Tddy



Re: speed

2005-08-22 Thread Philip M. Gollucci

Octavian Rasnita wrote:

Yes it involves a MySQL connection, but that MySQL database and that server
is not used by someone else so I don't understand why some pages show so
fast while others so slow.

Could be that MySQL has the queries cached in memory for some pages which would 
be a substantial
speed increase.  Other times, these queries might not be cached.  Depending on 
how much memory
you have available for the DB and how often the queries get used determines 
whats currently in the cache.


--
END

What doesn't kill us can only make us stronger.
Nothing is impossible.

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
  http://www.liquidityservicesinc.com
   http://www.liquidation.com
   http://www.uksurplus.com
   http://www.govliquidation.com
   http://www.gowholesale.com



Re: speed

2005-08-22 Thread Perrin Harkins
On Mon, 2005-08-22 at 20:47 +0300, Octavian Rasnita wrote:
 No. Unfortunately not. The server has no load, because it is a test server
 and I am the only user.
 It works locally, so the internet connection speed is not an issue either.

Sounds like an HTTP browser-compatibility problem to me.  IE is
notorious for having SSL problems that leave the connection stuck or
slow.  Try a different browser to test if that could be the problem.

- Perrin



Re: speed

2005-08-22 Thread Octavian Rasnita
From: Philip M. Gollucci [EMAIL PROTECTED]


 Octavian Rasnita wrote:
  Yes it involves a MySQL connection, but that MySQL database and that
server
  is not used by someone else so I don't understand why some pages show so
  fast while others so slow.
 Could be that MySQL has the queries cached in memory for some pages which
would be a substantial
 speed increase.  Other times, these queries might not be cached.
Depending on how much memory
 you have available for the DB and how often the queries get used
determines whats currently in the cache.



I don't think this is the problem, because that site shows more articles,
and each article has a counter that appears on the page. I am trying only
articles that have the counter 0, so nobody visited that page so MySQL
couldn't make a cache of that specific query.

Thank you.

Teddy



Re: speed

2005-08-22 Thread Philip M. Gollucci

Octavian Rasnita wrote:

I don't think this is the problem, because that site shows more articles,
and each article has a counter that appears on the page. I am trying only
articles that have the counter 0, so nobody visited that page so MySQL
couldn't make a cache of that specific query.


My best guess is bench mark each section:

DB time, PERL time, bandwith, SSLtime
and see which one it is


--
END

What doesn't kill us can only make us stronger.
Nothing is impossible.

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
  http://www.liquidityservicesinc.com
   http://www.liquidation.com
   http://www.uksurplus.com
   http://www.govliquidation.com
   http://www.gowholesale.com



Re: speed

2005-08-20 Thread Jonathan Vanasco

Please tell me how I can test:

- Why that 404 error appears

- Why sometimes it takes so long to display the same kind of page  
other

times displays much faster

- How can I test where the script hangs, which part of the script  
is so slow


I'd look into your apache error logs

you can also do a

 print STDERR crap

on certain blocks of  code and
tail -f /var/log/apache/mp_errorlog
(thats my error log for  modperl)

then look to see where stuff is hanging