Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running a website on Apache 2.4.9 that creates thumbnails of images a lot and when users browse the website they create cca 100 requests per page. Thumbnails are returned by PHP script that has to check if they are logged in.

I can't figure out why some requests take ridiculously long time to return the image.

This is output from ab. You can see that mean time to process the request (load image and send it back) is 302ms but worst time is 26.8s.

Concurrency Level:      1
Time taken for tests:   32.500 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      1236200 bytes
HTML transferred:       1216000 bytes
Requests per second:    3.08 [#/sec] (mean)
Time per request:       325.005 [ms] (mean)
Time per request:       325.005 [ms] (mean, across all concurrent requests)
Transfer rate:          37.14 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       15   23  19.6     18     146
Processing:    19  302 2675.4     25   26786
Waiting:       16   23  15.6     18     156
Total:         34  325 2674.8     45   26802

I thought maybe PHP is blocking something there or maybe there's some throttling limit? It looks like the same problem is with static resources so I guess there's something wrong with apache configuration.

Do you have any advice what should I try?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.