Re: php sometimes doesn't parses...

From: Date: Sat, 09 Dec 2000 06:03:45 +0000
Subject: Re: php sometimes doesn't parses...
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-40636@lists.php.net to get a copy of this message
> This situation deserves a well-constructed test. If the probability of it > happening is really low, then we should try lots of iterations. I propose > the following test: > > 1. Create a script like > > <? print("parsed"); ?> > > 2. Write a program in another language (Perl, C) that requests the PHP > script a large number of times. Count and record the returned > documents. > > If every returned document contains just the line "parsed", then the bug is > not found. Any other response is the demonstration of some problem > (though not necessarily this bug). There is probably some risk of > encountering timeouts if the server is overloaded. > > I'm not sure how many iterations is "large". Maybe someone else has > a suggestion. > > I can't recall any time I've seen this bug. > > Leon Actually, it can be even simpler than creating a tool to determine what's going on. If you have Apache installed on your own system or one you have access to, you can use the "ab" (Apache Bench) utility to do hardcore testing of your setup. For instance, on my box: [markhers@defiant ~]$ /opt/apache/sbin/ab \ http://www.green-ant.com/parse-test/parser.php -n 1000 [markhers@defiant ~]$ /opt/apache/sbin/ab \ http://www.green-ant.com/parse-test/parser.php -n 1000 This is ApacheBench, Version 1.3c <$Revision: 1.41 $> apache-1.3 Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright (c) 1998-1999 The Apache Group, http://www.apache.org/ Server Software: Apache/1.3.14 Server Hostname: www.green-ant.com Server Port: 80 Document Path: /parse-test/parser.php Document Length: 1 bytes Concurrency Level: 1 Time taken for tests: 12.145 seconds Complete requests: 1000 Failed requests: 0 Total transferred: 200000 bytes HTML transferred: 1000 bytes Requests per second: 82.34 Transfer rate: 16.47 kb/s received Connnection Times (ms) min avg max Connect: 0 1 15 Processing: 7 8 270 Total: 7 9 285 -- The parser.php script is simply: <?php echo 2+2; ?> -- Just blitz your server, and see what your results are. You should see that each request returns 1 byte (the number "4"). You should see IF you have failures, check your Apache logs and see if the byte count equals the bytes in your script file (in my example, ~22 bytes). If so, you're not getting parsed. If the byte count is much different, then there are more problem to deal with. In that case, you should create a database table and store the results to be analyzed. :) I threw a quick one together in MySQL, but need to work a little on it a little. Contact me if you'd be interested. Mark

« previous php.dev (#40636) next »