Re: [PHP] Determine overhead of PHP script.

2002-06-02 Thread Rasmus Lerdorf

PHP has a built-in mechanism for logging high-watermark memory usage by
scripts.  Make sure you compile PHP using --enable-memory-limit then you
can modify your Apache LogFormat and stick %{mod_php_memory_usage}n in
there somewhere which will be replaced with the peak memory usage for that
script in bytes.

-Rasmus

On Mon, 3 Jun 2002, Analysis & Solutions wrote:

> JH:
>
> On Sat, Jun 01, 2002 at 10:29:38PM -0400, John Holmes wrote:
> > Is there a way to determine the overhead or memory usage of a PHP script
> > as it runs?
>
> You could do some sort of exec() or system() type call.  For example, on
> a NetBSD (and similar unix type machines) you can do "ps -o rss,command"
>
> Enjoy,
>
> --Dan
>
> --
>PHP classes that make web design easier
> SQL Solution  |   Layout Solution   |  Form Solution
> sqlsolution.info  | layoutsolution.info |  formsolution.info
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
>  4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Determine overhead of PHP script.

2002-06-02 Thread Analysis & Solutions

JH:

On Sat, Jun 01, 2002 at 10:29:38PM -0400, John Holmes wrote:
> Is there a way to determine the overhead or memory usage of a PHP script
> as it runs? 

You could do some sort of exec() or system() type call.  For example, on 
a NetBSD (and similar unix type machines) you can do "ps -o rss,command"

Enjoy,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Determine overhead of PHP script.

2002-06-01 Thread Bogdan Stancescu

It's more of a time-consuming issue rather than memory usage IMHO. 
However, unless you make several extra database requests, I found that 
running PHP code is generally rather fast and adding considerable extra 
code doesn't affect the speed significantly. I must reiterate however 
that if your templating engine uses a database, that might increase 
parsing duration considerably. For your own tests, take a look at 
microtime() on php.net.

Bogdan

John Holmes wrote:

>Is there a way to determine the overhead or memory usage of a PHP script
>as it runs? 
> 
>What I'm looking at is say I've got this nice simple script to display
>info. Now I want to add a database abstraction layer and a template
>engine. Sure, this makes it easy for me to control changes, but now I'm
>including a dozen other files that I may only use a percentage of. So,
>yeah, it's easy to control, but now it may be taking up 10 times as much
>memory as it was before. 
> 
>So is there a way to see how much memory/overhead a script is taking up
>after it does all of its includes?
> 
>Let me know if I need to explain this more. 
> 
>I'm on a windows machine, but any ideas you have are welcome. I'm sure
>it's more of an OS-type question, though.
> 
>---John Holmes.
>
>  
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php