php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28065 resource limits do not work
Submitted: 2004-04-19 19:49 UTC Modified: 2004-04-22 15:12 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: floeff at arcor dot de Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 4.3.6 OS: Linux 2.4.26
Private report: No CVE-ID: None
 [2004-04-19 19:49 UTC] floeff at arcor dot de
Description:
------------
Maybe I misunderstand something, but for me it seems that the resource limits do not work. In my php.ini, I set

max_execution_time = 10
max_input_time = 10

which - to my understanding - should limit executing time for scripts to 10 seconds.

I have PHP running as CGI with Apache 2.0.49 on Linux 2.4.26 here, and with a hughe PHP file involving some diagram creation, I can kill the machine if I re-load the script for five seconds continuously. It soaks up all my memory and runs for nearly a minute.

What could be wrong in here? If you need more information, please let me know. Thanks!



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-19 23:23 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

.
 [2004-04-20 19:05 UTC] floeff at arcor dot de
If PHP does not terminate after the set amount of time, then for me it is a bug. Why shouldn't it be one?
 [2004-04-21 21:36 UTC] floeff at arcor dot de
I checked some more things, here some more results:

- On my test machine, I've set MaxClients in httpd.conf to 20 and I couldn't kill the machine anymore. This is only a workaround, as it knocks out a lot of users on higher load machines, but at least it shows that MaxClients
works for that.

- When a "normal access" (i.e. not my "attack") accesses a PHP script, the PHP parser is only shown during the run of the script, checked with ps auxw | grep php. However, when I "attack", it runs for quite a while several times. It does seem to use the 300 seconds timeout, as I lowered this to 10
seconds, and the scripts got killed with "(70007)The timeout specified has expired: ap_content_length_filter: apr_bucket_read() failed". However, it does not help to lower it, the load rises even more. Had about 97 (!) some
seconds ago :-( "killall php" or "killall -9 php" doesn't help. However, shutting down Apache brings down the PHP interpreters, so I think that Apache just "forgets" about the running instances when it is flooded and cannot handle them anymore.

Do you have any idea? Do you need more information?
 [2004-04-22 09:29 UTC] derick@php.net
1. Don't run Apache 2
2. Don't run PHP as CGI

Do use apache 1.3 with the apache SAPI and this works fine; apache 2 is NOT ready for production.
 [2004-04-22 15:11 UTC] floeff at arcor dot de
> Don't run PHP as CGI

I need to run PHP as a user, so there only seems to be the CGI method. Does memory limitation not work for CGI?
 [2004-04-22 15:12 UTC] floeff at arcor dot de
> Don't run PHP as CGI

I need to run PHP as a user, so there only seems to be the CGI method. Does memory limitation not work for CGI?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 19:01:28 2024 UTC