[PHP-DB] how should i test my php program performance?
Dear all: I have wrote a php program and use mysql database. Is there a way to test its performance? Thanks. haheho -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] how should i test my php program performance?
Hi, You can get the time(); or microtime(); (in linux) in the beginning and in the endo of the code.. example: ? $t1 = time(); code... $t2 = time(); echo Total time is.($t2 - $t1).seconds.; ? []s Ferreras Dear all: I have wrote a php program and use mysql database. Is there a way to test its performance? Thanks. haheho -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] how should i test my php program performance?
?php $starttime=explode(' ',microtime()); // code is here // // $endtime=explode(' ',microtime()); $starttime=$starttime[1]+$starttime[0]; $endtime=$endtime[1]+$endtime[0]; $parse_time=$endtime-$starttime; ? Try apache benchmarking tool to view what is the peak of executions per second. I don't use linux but think that the name of the executable is 'ab' Andrey Hristov http://www.icygen.com 99% - Original Message - From: haheho [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 22, 2001 6:23 PM Subject: [PHP-DB] how should i test my php program performance? Dear all: I have wrote a php program and use mysql database. Is there a way to test its performance? Thanks. haheho -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] how should i test my php program performance?
There are a few different things you can test here... I. Server Performance (overall) I don't have the name of any specific tool off hand, but basically you would request a slew of .php pages off of the server via HTTP and record how many pages/second actually are served up. This is really the only thing that matters in the Real World. II. Script Performance The replies to this thread have already mentioned functions which will help you calculate total time spent in a script. Good things to know, definately, but not the absolute answer. Quite often it's beneficial to place various outputs along your program (or script in this case) to figure out where any bottle knecks my lie. Personally, I place them just before and after a DB call to differentiate slow-downs between my actual code vs. my SQL code. This way you get to target specifically which pieces need optimization, if any. If II is plenty fast for you, but I isn't... start looking at processes running on the system which you don't need. If beyond that you want to squeak more out of the system, start optimizating your web-server config. Before anything though, a quick Big O analysis of your script could help point to performance problems before you can even see them in a benchmark. Justin Buist Trident Technology, Inc. 4700 60th St. SW, Suite 102 Grand Rapids, MI 49512 Ph. 616.554.2700 Fx. 616.554.3331 Mo. 616.291.2612 On Wed, 22 Aug 2001, haheho wrote: Dear all: I have wrote a php program and use mysql database. Is there a way to test its performance? Thanks. haheho -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]