views:

41

answers:

3

Hi all, For my research purposes, I have modified the php sinterpreter and I want to test the response time of the new modified interpreter. So I am looking for a script that would help me achieve my objective.

I could simply request for a page which records start time and the end time but I want to measure the average time taken for 100 requests. Will Ajax or something be of help. I have no clue as how to go about it. Any help would be greatly appreciated!

A: 

Make a batch file by yourself, store all the results in a text file. (sorry I'm not experienced in writing scripts, but I'm sure you'll figure it out.)
For querying the server there are libraries developed for C++/C#/Java etc.

Victor Z.
+4  A: 

A 'page' seems to imply 'test PHP in the webserver' (rather then command line).

Apache's ab works pretty OK for it:

$ ab -c 5 -n 200   http://example.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking example.com (be patient)
Completed 100 requests
Completed 200 requests
Finished 200 requests


Server Software:        Apache
Server Hostname:        example.com
Server Port:            80

Document Path:          /
Document Length:        596 bytes

Concurrency Level:      5
Time taken for tests:   15.661 seconds
Complete requests:      200
Failed requests:        0
Write errors:           0
Total transferred:      173600 bytes
HTML transferred:       119200 bytes
Requests per second:    12.77 [#/sec] (mean)
Time per request:       391.532 [ms] (mean)
Time per request:       78.306 [ms] (mean, across all concurrent requests)
Transfer rate:          10.82 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      184  193   8.9    190     235
Processing:   184  196  13.2    192     280
Waiting:      184  196  13.2    192     280
Total:        368  390  15.0    387     469

Percentage of the requests served within a certain time (ms)
  50%    387
  66%    393
  75%    398
  80%    400
  90%    410
  95%    418
  98%    423
  99%    446
 100%    469 (longest request)
Wrikken
Looks Cool.. But can you think of a script to do the same?
Karthick
Why would one do that? Just call call `exec` on it or something, it can output csv if you like. Writing a script to do it is quite easy, but incurs a lot of overhead from the script itself.
Wrikken
Thats because I have modified several api's and I want to check the overhead incurred due to the modifications!
Karthick
Wrikken
@Karthick would you like a 'script' type solution because you need the information in a more structured way then the textual output of apachebench?
Alex JL
@Alex: that's why I mentioned the possibility of CSV output instead of the standard texts (which pretty much is as structured as one can get).
Wrikken
Yes.. For example, I have modified the mysql_connect api. I want to check the reponse time with/without modification in mysql_connect api..
Karthick
Wrikken
A: 

What about running a local website and timing it with iMacros for Firefox/Chrome/IE and its STOPWATCH command? We use that for web performance testing.

You can run the test sequence 100x with the Loop button on the iMacros sidebar.

FrankJK