Re: CGI quick cleanup
| From: | Edin Kadribasic | Date: | Fri, 23 Nov 2001 10:50:17 +0000 |
| Subject: | Re: CGI quick cleanup | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-71455@lists.php.net to get a copy of this message | ||
I have noticed the same problem with a scipt that used a very large array
(~160 MB). The script run time was around 35 seconds, while it took over 4
minutes to shut down! Same amount of time was used in trying to unset() the
array.
Edin
----- Original Message -----
From: "Sam Liddicott" <sam.liddicott@ananova.com>
To: "Sam Liddicott" <sam.liddicott@ananova.com>; <php-dev@lists.php.net>
Sent: Friday, November 23, 2001 11:41 AM
Subject: RE: [PHP-DEV] CGI quick cleanup
> I should add that without the kill -5 it takes longer for the script to
> finally exit than it took to execute!
>
> Sam
>
> > -----Original Message-----
> > From: Sam Liddicott [mailto:sam.liddicott@ananova.com]
> > Sent: 23 November 2001 10:35
> > To: php-dev@lists.php.net
> > Subject: [PHP-DEV] CGI quick cleanup
> >
> >
> > I am using PHP for a system script to import TV listings to a
> > database.
> >
> > It works well but creates 20,000 to 30,000 hash elements with various
> > relationships and it *seems* to take exponentially longer for
> > the script to
> > actually stop running after it reaches the "exit" statement
> > the more items
> > there are.
> >
> > I also note that even though max execution time is set to zero and the
> > script runs for a long time, I still get a max-execution
> > error at 30 seconds
> > after the script has been trying to exit (although the script
> > runs for many
> > minutes). 30 seconds is the timeout in the php.ini which I
> > override with
> > ini_set.
> >
> > I think this long shutdown time is PHP's per-page cleanup
> > freeing all the
> > objects, which is not so important if running as a CGI.
> >
> > Currently I am quitting with
> > posix_kill(posix_getpid(),5)
> > as it is pretty quick
> >
> > but I wondered if the per-page cleanup which is only
> > important when running
> > as an apache module could be disabled in cgi mode.
> >
> > Sam