Piotr, Not sure to express myself in the most correct way, however the PHP process is handled by suPHP. I have noticed that suPHP does not consider the php.ini timeout. I think this is a drawback of the design of suPHP.
Gregory 2010/4/14 Piotr Kloc <[email protected]> > Hello ! > I have simple php script > > <?php > $number = 3000; > while($number > 0) { > $number--; > sleep(2); > } > ?> > In apache I have 30 second timeout set so the apache tries to kill the > process but got EPERM from kill() > > > r...@server:/usr/local/directadmin/custombuild# strace -s 1024 -p 2041 > Process 2041 attached - interrupt to quit > epoll_wait(18, {}, 2, 30000) = 0 > epoll_wait(18, {}, 2, 30000) = 0 > gettimeofday({1271278209, 688889}, NULL) = 0 > write(7, "[Wed Apr 14 22:50:09 2010] [error] [client 83.15.188.122] Script > timed out before returning headers: b.php\n"..., 107) = 107 > epoll_wait(18, {}, 2, 30000) = 0 > read(22, 0xbfeff02c, 1) = -1 EAGAIN (Resource temporarily > unavailable) > stat64("/home/admin/domains/dotestow.idl.pl/public_html/500.shtml", > {st_mode=S_IFREG|0755, st_size=515, ...}) = 0 > open("/home/admin/domains/dotestow.idl.pl/public_html/500.shtml", > O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 19 > fcntl64(19, F_GETFD) = 0x1 (flags FD_CLOEXEC) > fcntl64(19, F_SETFD, FD_CLOEXEC) = 0 > mmap2(NULL, 515, PROT_READ, MAP_SHARED, 19, 0) = 0xb79e5000 > brk(0x8ae0000) = 0x8ae0000 > brk(0x8b01000) = 0x8b01000 > mmap2(NULL, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) > = 0xb78ee000 > munmap(0xb79e5000, 515) = 0 > munmap(0xb78ee000, 135168) = 0 > writev(17, [{"HTTP/1.1 500 Internal Server Error\r\nDate: Wed, 14 Apr 2010 > 20:48:59 GMT\r\nServer: Apache/2\r\nAccept-Ranges: bytes\r\nVary: > Accept-Encoding,User-Agent\r\nContent-Encoding: gzip\r\nContent-Length: > 231\r\nConnection: close\r\nContent-Type: text/html\r\n\r\n"..., 238}, > {"\37\213\10\0\0\0\0\0\0\3"..., 10}, > {"\335\217\301N\3!\20\206\357\373\24c\357.\253\2117Bb\vMIV\333(\36z\244\273\243%\241Pg\301\306\267\27\272\361\350\v8\231\313\317|3\371\3407r\2732\373\235\202\215y\352a\367\266\354\365\n\26\267\214ie\326\214I#\347\311}\3331\246\236\27\242\3415\v\276Q\217\262\4\243M\257\304C\327\201\16\t)X\17\257H_H\240\210\"q6\3\rg\327\5\276\334\312}\275q'\376\340\313\2441G\204i~\3050\304\\I\34\301\6p\277KXi(}r\323\20\303\273\373\310d\223\213\241P#\\\354\0049\330\203GH\21\206x:{L\10\3371\23\20~f\234Rqx)\"Z\2141\225\30/\255\33}{\366\234\351j{\365,6\365\257\315?\253\37"..., > 213}, {"\rN\3~\365\1\0\0"..., 8}], 4) = 469 > gettimeofday({1271278239, 690469}, NULL) = 0 > write(9, "469\n"..., 4) = 4 > write(10, "83.15.188.122 - - [14/Apr/2010:22:48:59 +0200] \"GET /b.php > HTTP/1.1\" 500 469 \"-\" \"Opera/9.80 (Windows NT 5.1; U; pl) Presto/2.5.22 > Version/10.51\"\n"..., 146) = 146 > gettimeofday({1271278239, 690663}, NULL) = 0 > times({tms_utime=0, tms_stime=0, tms_cutime=0, tms_cstime=0}) = 432150076 > gettimeofday({1271278239, 690750}, NULL) = 0 > shutdown(17, 1 /* send */) = 0 > poll([{fd=17, events=POLLIN}], 1, 2000) = 1 ([{fd=17, > revents=POLLIN|POLLHUP}]) > read(17, ""..., 512) = 0 > close(17) = 0 > read(5, 0xbff032d3, 1) = -1 EAGAIN (Resource temporarily > unavailable) > close(19) = 0 > close(18) = 0 > close(22) = 0 > close(20) = 0 > waitpid(3131, 0xbff03224, WNOHANG|WSTOPPED) = 0 > kill(3131, SIGTERM) = -1 EPERM (Operation not > permitted) > kill(3131, SIGKILL) = -1 EPERM (Operation not > permitted) > waitpid(3131, 0xbff03224, WSTOPPED) = ? ERESTARTSYS (To be restarted) > > So there is some wrong with mod_suphp ,apache is unable to kill the php > process if the timeout is reached. > > regards, > Piotr > > > _______________________________________________ > suPHP mailing list > [email protected] > https://lists.marsching.com/mailman/listinfo/suphp > >
_______________________________________________ suPHP mailing list [email protected] https://lists.marsching.com/mailman/listinfo/suphp
