Re: [PHP] PHP and Apache Using up all memory

2004-03-07 Thread Raditha Dissanayake
The RLimit* set of directive can define resource limitations  in apache. 
There is also aSendBufferSize directive but haven't used that so can't 
comment. According to the situation that you describe perhaps saving the 
file first isn't the solution either.

Juan E Suris wrote:

Right now I am genereating the file offline and using a hyperlink, but that
creates double the disk I/O. It reads some files (which the big file is
based on), writes the big file, and reads the big file (to deliver it when
the user clicks the hyperlink). If I could just create the file and deliver
it as I create it, I would save the write/read to/from disk of the big file.
Output buffering is off in php.ini:
output_buffering = Off
So that does not seem to be it. Maybe the problem should be address on
Apache instead of PHP?
Thanks,
Juan
- Original Message - 
From: "Raditha Dissanayake" <[EMAIL PROTECTED]>
To: "Juan E Suris" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, March 06, 2004 11:44 PM
Subject: Re: [PHP] PHP and Apache Using up all memory

 

Hi Juan,

What you can do is to switch off output buffering. If it is a really
large file you might want to generate the file offline and deliver it
using the more conventional hyperlink.
all the best

Juan E Suris wrote:

   

Hi!
 

   

 



--
Raditha Dissanayake.
---
http://www.radinks.net/ftp/applet/
An applet that breaks all the rules. Reads, Writes and Deletes files on 
your hard disk. Uploads what's left to a third party server.

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


Re: [PHP] PHP and Apache Using up all memory

2004-03-06 Thread Juan E Suris
Right now I am genereating the file offline and using a hyperlink, but that
creates double the disk I/O. It reads some files (which the big file is
based on), writes the big file, and reads the big file (to deliver it when
the user clicks the hyperlink). If I could just create the file and deliver
it as I create it, I would save the write/read to/from disk of the big file.

Output buffering is off in php.ini:
output_buffering = Off

So that does not seem to be it. Maybe the problem should be address on
Apache instead of PHP?
Thanks,
Juan

- Original Message - 
From: "Raditha Dissanayake" <[EMAIL PROTECTED]>
To: "Juan E Suris" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, March 06, 2004 11:44 PM
Subject: Re: [PHP] PHP and Apache Using up all memory


> Hi Juan,
>
> What you can do is to switch off output buffering. If it is a really
> large file you might want to generate the file offline and deliver it
> using the more conventional hyperlink.
>
> all the best
>
> Juan E Suris wrote:
>
> >Hi!
> >
> >I have a problem with PHP and Apache, where Apache uses up a huge amount
of memory. What happens is that I have a PHP script that creates a file on
the fly and sends it directly to the broswer (as an attachment, so that the
user can save it). The problem is that when the file is big and the client
download speed is slow, the Apache process uses up as much memory as the
file size. My guess here is that PHP keeps writing data as fast as it can,
and Apache caches it in memory until the user can download it all.
> >
> >Is there any way to avoid this?
> >
> >My apologies if this is an obvious question.
> >
> >Thanks,
> >Juan
> >
> >
>
>
> -- 
> Raditha Dissanayake.
> ---
> http://www.radinks.net/ftp/applet/
> An applet that breaks all the rules. Reads, Writes and deletes files on
> your hard disk. Uploads what's left to a third party server.
>
>

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



Re: [PHP] PHP and Apache Using up all memory

2004-03-06 Thread Raditha Dissanayake
Hi Juan,

What you can do is to switch off output buffering. If it is a really 
large file you might want to generate the file offline and deliver it 
using the more conventional hyperlink.

all the best

Juan E Suris wrote:

Hi!

I have a problem with PHP and Apache, where Apache uses up a huge amount of memory. What happens is that I have a PHP script that creates a file on the fly and sends it directly to the broswer (as an attachment, so that the user can save it). The problem is that when the file is big and the client download speed is slow, the Apache process uses up as much memory as the file size. My guess here is that PHP keeps writing data as fast as it can, and Apache caches it in memory until the user can download it all.

Is there any way to avoid this?

My apologies if this is an obvious question.

Thanks,
Juan 
 



--
Raditha Dissanayake.
---
http://www.radinks.net/ftp/applet/
An applet that breaks all the rules. Reads, Writes and deletes files on 
your hard disk. Uploads what's left to a third party server.

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


[PHP] PHP and Apache Using up all memory

2004-03-06 Thread Juan E Suris
Hi!

I have a problem with PHP and Apache, where Apache uses up a huge amount of memory. 
What happens is that I have a PHP script that creates a file on the fly and sends it 
directly to the broswer (as an attachment, so that the user can save it). The problem 
is that when the file is big and the client download speed is slow, the Apache process 
uses up as much memory as the file size. My guess here is that PHP keeps writing data 
as fast as it can, and Apache caches it in memory until the user can download it all.

Is there any way to avoid this?

My apologies if this is an obvious question.

Thanks,
Juan