Karthick
Karthick

Reputation: 2882

Testing Response Time of PHP

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.

Upvotes: 0

Views: 1736

Answers (1)

Wrikken
Wrikken

Reputation: 70510

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)

Upvotes: 4

Related Questions