Efficiency, benchmarking, speed testing, performance

I am trying to write a script whose effectiveness I am trying to measure. I have a couple of questions: -

  • For small applications, does such profiling require? Or am I getting paranoid? (assuming most code is decently efficient / without endless loops)
  • Against what should I check? What to compare with?
  • The following is a performance result obtained from ab. Is this too much? Am I heading in the wrong direction while developing this application? Are there any warning signals I should be aware of?
abs -n10000 -c100 http: // localhost / testapp

This is ApacheBench, Version 2.3 
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software: Apache / 2.2.10
Server Hostname: localhost
Server Port: 80

Document Path: / testapp
Document Length: 525 bytes

Concurrency Level: 100
Time taken for tests: 33.608 seconds
Complete requests: 10000
Failed requests: 5179
   (Connect: 0, Receive: 0, Length: 5179, Exceptions: 0)
Write errors: 0
Total transferred: 6973890 bytes
HTML transferred: 5253890 bytes
Requests per second: 297.55 [# / sec] (mean)
Time per request: 336.080 [ms] (mean)
Time per request: 3.361 [ms] (mean, across all concurrent requests)
Transfer rate: 202.64 [Kbytes / sec] received

Connection Times (ms)
              min mean [+/- sd] median max
Connect: 0 1 1.5 0 109
Processing: 8 334 403.9 176 3556
Waiting: 7 334 403.9 176 3556
Total: 9 335 403.8 177 3556

Percentage of the requests served within a certain time (ms)
  50% 177
  66% 296
  75% 415
  80% 519
  90% 842
  95% 1141
  98% 1615
  99% 1966
 100% 3556 (longest request)

I am using PHP to write a script. During further testing, I also found that "Failed requests" becomes 0 if I comment on part of the MySQL connection from my PHP script. What's wrong? How to reduce this failure rate?

Thanks Alec

+3
5

100 ? 10K 30 ?

, , , . , . :

  • , 3000 .
  • , 500
  • - 3 : 3 * 500 / 60 = ~ 25 req/sec
  • 25 req/sec (< 200ms )?

, 100 . . , ( , .., , ).

script, xdebug, , .

+6

, . ? , .

, . script , , , , .

: , , , .

? 1000 ? , , .

? .

, script? , ?

, , , . , .

+1

- , , .

, MySQL , , ( ).

+1

xdebug, . xdebug .

Then use webgrind to view the profile in good format.

+1
source

~ 200 ms per request - somewhat the total number on which the page looks "fast" for most users.

0
source

Source: https://habr.com/ru/post/1702363/


All Articles