|
Posted by lawpoop on 07/11/07 17:40
On Jul 10, 7:42 pm, NC <n...@iname.com> wrote:
> On Jul 10, 12:26 pm, lawp...@gmail.com wrote:
>
>
>
> > I have a problem with a php page. I have a setup with Apache 2.0, PHP
> > 5 and Postgres 8.1 on Debian 4.0. My script uses simplexml to parse
> > large xml files ( 8 files at 2-15 MB ea. ) and do inserts into the
> > database.
>
> > The problem is twofold. One, output on the parsing page seems to come
> > in starts and fits. I have a message to the user that gets echoed each
> > time parsing a file is finished; but these messages come all at once,
> > like two or three at a time. In other words, the message doesn't come
> > when the parsing is finished; they seem to build up. It's a simple
> > loop so I don't think the problem is in the program
>
> This is normal behavior; either your server :
>
> http://www.php.net/flush
>
> > Also, when I am going through the parsing loop for a set of files,
> > the rest of the site doesn't respond until the looping is over. The
> > parsing seems to basically stop all web serving.
>
> > How can I find out if the problem is with Apache, PHP, or Postgres?
>
> All of the above. When you start parsing and writing the results into
> the database, PHP and Postgres lean very heavily on both memory and
> CPU, so there is almost nothing left for the rest of your
> application. Run top during parsing and see for yourself.
>
> Cheers,
> NC
I tested Apache serving a static HTML webpage, and that got served up
in a timely manner during parsing.
I understand Postgres getting bogged down with selects and inserts,
but there's only one instance of the PHP parser than can parse web
pages? That if one PHP script is bogging down on the server, all PHP
scripts will be bogged down?
Navigation:
[Reply to this message]
|