Mittwoch, 24. Juli 2013

PHP - Anzahl der includes keine Frage der Performance

Die Frage ist die ob die Anzahl der includes in einem PHP Script unter Last einen nennenswerten Einfluss auf die Performance hat.

Tatsächlich ist der Einfluss minimal und kaum messbar wie nachfolgender Test beweist:



100 includes

 siege -b -c500 --time=1M http://localhost/cmsms/test.php
** SIEGE 3.0.1
** Preparing 500 concurrent users for battle.
The server is now under siege...
Lifting the server siege..      done.

Transactions:      169594 hits
Availability:      100.00 %
Elapsed time:       59.99 secs
Data transferred:       95.75 MB
Response time:        0.18 secs
Transaction rate:     2827.04 trans/sec
Throughput:        1.60 MB/sec
Concurrency:      495.79
Successful transactions:      169594
Failed transactions:           0
Longest transaction:        1.99
Shortest transaction:        0.00


15  includes

siege -b -c500 --time=1M http://localhost/cmsms/test.php
** SIEGE 3.0.1
** Preparing 500 concurrent users for battle.
The server is now under siege...
Lifting the server siege..      done.

Transactions:      177616 hits
Availability:      100.00 %
Elapsed time:       59.98 secs
Data transferred:       13.72 MB
Response time:        0.17 secs
Transaction rate:     2961.25 trans/sec
Throughput:        0.23 MB/sec
Concurrency:      495.53
Successful transactions:      177616
Failed transactions:           0
Longest transaction:        2.05
Shortest transaction:        0.00

10  includes

siege -b -c500 --time=1M http://localhost/cmsms/test.php
** SIEGE 3.0.1
** Preparing 500 concurrent users for battle.
The server is now under siege...
Lifting the server siege..      done.

Transactions:      177179 hits
Availability:      100.00 %
Elapsed time:       59.82 secs
Data transferred:        8.62 MB
Response time:        0.17 secs
Transaction rate:     2961.87 trans/sec
Throughput:        0.14 MB/sec
Concurrency:      495.40
Successful transactions:      177184
Failed transactions:           0
Longest transaction:        2.15
Shortest transaction:        0.00

5  includes
siege -b -c500 --time=1M http://localhost/cmsms/test.php
** SIEGE 3.0.1
** Preparing 500 concurrent users for battle.
The server is now under siege...
Lifting the server siege..      done.

Transactions:      170573 hits
Availability:      100.00 %
Elapsed time:       59.91 secs
Data transferred:        4.07 MB
Response time:        0.17 secs
Transaction rate:     2847.15 trans/sec
Throughput:        0.07 MB/sec
Concurrency:      493.93
Successful transactions:      170573
Failed transactions:           0
Longest transaction:        3.36
Shortest transaction:        0.00

1  include

 siege -b -c500 --time=1M http://localhost/cmsms/test.php
** SIEGE 3.0.1
** Preparing 500 concurrent users for battle.
The server is now under siege...
Lifting the server siege..      done.

Transactions:      176788 hits
Availability:      100.00 %
Elapsed time:       59.90 secs
Data transferred:        0.84 MB
Response time:        0.17 secs
Transaction rate:     2951.39 trans/sec
Throughput:        0.01 MB/sec
Concurrency:      495.67
Successful transactions:      176788
Failed transactions:           0
Longest transaction:        2.05
Shortest transaction:        0.00

Keine Kommentare: