I am trying to write a script whose efficiency I am trying to measure. I have a few questions: -
- For small applications, does this framework be required? Or am I going mad? (Handling most codes is properly efficient / no limitless edge)
- What benchmark do I want against this? Who should I compare with?
- The efficiency output given below which I have met now is this way too close? Am I going in the wrong direction designing this app? Are there any warning signs that I should be aware of?
abs -n10000-c100 http: // localhost / testapp This is Apache batch, Version 2.3 Copyright 1999 Adam Twice, Zeus Technology Ltd., http: //www.zeustech.net/ License for Apache Software Foundation, http://www.apache.org/ Benchmarking Localhost (Patience) Full 1000 Request Completed 2000 Requested Completed 3000 Requested Full 4000 Request Completed 5000 Request Completed 6000 Requested Full 7000 Request Full 8000 Completed Request 9000 Request Full 10000 Request Full 10000 Request Server Soft Server: Apache / 2.2.10 Server Host Name: Public Host Server Port: 80 Document Path: / testapp Document Length: 525 Bytes Concurrency Level: Time taken for 100 Trials: 33.608 seconds Full Request: 10000 Failed Request: 5179 (Connect : 0, Receive: 0, Length: 5179, Exception: 0) Write errors: 0 Total transferred: 6973890 bytes transferred HTML: 5253890 bytes Request per second: 297.55 [/ sec] Time to request: 336.080 [MS] (mean ) For request Time: 3.361 [ms] (between all concurrent requests) Transfer Rate: 202.64 [Kbytes / sec] Connection Time Received (MS) Mean Minimum [+/- SD] Average 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 percent A fixed time (MS) 50% 177 66% 296 75% 415 80% 51 9 90% 842 95% 1141 98% 1615 99% 1 9 66 100% 3556 (longest request) Within the service request
I am using PHP to write scripts. On further testing, I also learned that "failed request" becomes 0 if I comment on the MySQL connection part from my PHP script. What is wrong? How can I reduce this failure rate?
Thanks, Alec
Do you expect 100 concurrent requests? Do you expect to get 10K requests in 30 seconds?
It's great that you can run this benchmark, but ask yourself what it means. Think about the actual amount of traffic that you will get. You really need a question for the benchmark:
- I hope that my site will have 3,000 users.
- I hope during the peak usage, 500 pages of them
- More than 3 minutes are requested:
3 * 500/60 = ~ 25 Req / sec
- Is my site 25 req / second and responsive (& lt; 200ms per request)?
Unless you are in the top few percent of the web, your page will not see 100 concurrent requests in real life. Tune your site to that level of traffic does not mean to kill those numbers, you need to design the design in architecture level (database usage, caching methods, etc.): Therefore, the number of failures when database is turned on .)
If you are just trying to profile your script, use it to know why your code is spending that time.
Comments
Post a Comment