Yii Apc Performance Suggestion

I have pasted two scenario of Apache Workbench Testing of Myapplication at Localhost.

But i didn’t found any significant change after APC cache implementation.

Can anyone suggest.

Without APC Cache Implementation

bash-4.1$ ab -n 100 http://localhost/mywebsite.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 localhost (be patient)…done

Server Software: Apache/2.2.15

Server Hostname: localhost

Server Port: 80

Document Path: /mywebsite.com/

Document Length: 51841 bytes

Concurrency Level: 1

Time taken for tests: 111.972 seconds

Complete requests: 100

Failed requests: 0

Write errors: 0

Non-2xx responses: 100

Total transferred: 5222800 bytes

HTML transferred: 5184100 bytes

Requests per second: 0.89 [#/sec] (mean)

Time per request: 1119.724 [ms] (mean)

Time per request: 1119.724 [ms] (mean, across all concurrent requests)

Transfer rate: 45.55 [Kbytes/sec] received

Connection Times (ms)

          min  mean[+/-sd] median   max

Connect: 0 0 0.0 0 0

Processing: 910 1120 350.3 1049 4279

Waiting: 905 1114 350.3 1044 4274

Total: 910 1120 350.3 1049 4279

Percentage of the requests served within a certain time (ms)

50% 1049

66% 1068

75% 1088

80% 1136

90% 1268

95% 1517

98% 1860

99% 4279

100% 4279 (longest request)

[b]

With APC Cache Implementationm[/b]

bash-4.1$ ab -n 100 http://localhost/mywebsite.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 localhost (be patient)…done

Server Software: Apache/2.2.15

Server Hostname: localhost

Server Port: 80

Document Path: /mywebsite.com/

Document Length: 51841 bytes

Concurrency Level: 1

Time taken for tests: 112.384 seconds

Complete requests: 100

Failed requests: 0

Write errors: 0

Non-2xx responses: 100

Total transferred: 5222800 bytes

HTML transferred: 5184100 bytes

Requests per second: 0.89 [#/sec] (mean)

Time per request: 1123.844 [ms] (mean)

Time per request: 1123.844 [ms] (mean, across all concurrent requests)

Transfer rate: 45.38 [Kbytes/sec] received

Connection Times (ms)

          min  mean[+/-sd] median   max

Connect: 0 0 0.0 0 0

Processing: 594 1124 316.5 1027 3447

Waiting: 593 1123 316.5 1026 3446

Total: 594 1124 316.5 1027 3447

Percentage of the requests served within a certain time (ms)

50% 1027

66% 1089

75% 1192

80% 1233

90% 1342

95% 1527

98% 2237

99% 3447

100% 3447 (longest request)

APC Setting:

id Local Setting Global Setting Access Level

apc.cache_by_default 1 1 all

apc.canonicalize 0 0 system

apc.coredump_unmap 0 0 system

apc.enable_cli 0 0 system

apc.enabled 1 1 system

apc.file_md5 0 0 system

apc.file_update_protection 2 2 system

apc.filters system

apc.gc_ttl 3600 3600 system

apc.include_once_override 0 0 system

apc.lazy_classes 00 00 system

apc.lazy_functions 0 0 system

apc.max_file_size 2M 2M system

apc.mmap_file_mask /tmp/apc.S4xvO9 /tmp/apc.S4xvO9 system

apc.num_files_hint 1024 1024 system

If anything else require you may please mention in comment.

Within the apc package there is a file called apc.php - use that to see if your files are cached and if APC is working properly (see cache hits, should increase when (multiple) refreshing the page…)

Cheers

This might be trivial but … have you restarted Apache after installing apc?

[b]Hello,I have restarted APC & getting hits increased also.

Also some tweaks for increasing performance. But not able to measure actual difference after APC implementation.

I am testing via apache workbench of my site at localhost (RHEL6). Can you suggest me any other tool for measuring performance.

Does apc.enable_cli needs to be enabled to test performance with apache workbench?

[/b]

General Cache Information

APC Version 3.1.13

PHP Version 5.3.3

APC Host www.example.com (example-amazon.com) (10.123.35.73)

Server Software Apache/2.2.15 (Red Hat)

Shared Memory 1 Segment(s) with 192.0 MBytes

(mmap memory, pthread read/write Locks locking)

Start Time 2013/10/07 20:43:46

Uptime 13 hours and 54 minutes

File Upload Support 1

File Cache Information

Cached Files 588 ( 97.3 MBytes)

Hits 3929893

Misses 949

Request Rate (hits, misses) 78.50 cache requests/second

Hit Rate 78.48 cache requests/second

Miss Rate 0.02 cache requests/second

Insert Rate 0.13 cache requests/second

Cache full count 0

User Cache Information

Cached Variables 0 ( 0.0 Bytes)

Hits 0

Misses 0

Request Rate (hits, misses) 0.00 cache requests/second

Hit Rate 0.00 cache requests/second

Miss Rate 0.00 cache requests/second

Insert Rate 0.00 cache requests/second

Cache full count 0

Runtime Settings

apc.cache_by_default 0

apc.canonicalize 0

apc.coredump_unmap 0

apc.enable_cli 0

apc.enabled 1

apc.file_md5 0

apc.file_update_protection 2

apc.filters

apc.gc_ttl 3600

apc.include_once_override 0

apc.lazy_classes 00

apc.lazy_functions 0

apc.max_file_size 2M

apc.mmap_file_mask /tmp/apc.uKnNBk

apc.num_files_hint 1024

apc.preload_path

apc.report_autofilter 0

apc.rfc1867 0

apc.rfc1867_freq 0

apc.rfc1867_name APC_UPLOAD_PROGRESS

apc.rfc1867_prefix upload_

apc.rfc1867_ttl 3600

apc.serializer default

apc.shm_segments 1

apc.shm_size 192M

apc.slam_defense 1

apc.stat 0

apc.stat_ctime 0

apc.ttl 604800

apc.use_request_time 1

apc.user_entries_hint 0

apc.user_ttl 14400

apc.write_lock 1

[b]

Free: 94.5 MBytes (49.2%) Hits: 3932724 (100.0%)

Used: 97.5 MBytes (50.8%) Misses: 949 (0.0%)[/b]

Fragmentation: 0.00% ( 3.8 KBytes out of 94.5 MBytes in 2 fragments)

Well, everything seems to be in order. This is leaving me puzzled why you are seeing no performance increase. ab is pretty much the standard tool for measuring webserver and webapplication performance. Can you check if the URL you are pointing ab at is actually hitting something that involves PHP?

Is there any standard configuration required to test with apache workbench to localhost website?

Do we require to give URL like

www.example.com/default_controller_name/index

or

www.example.com

or

www.example.com/

,because apache workbench gives different result for all these url referrring to same page.

If memory serves me correctly, ab won’t follow redirects. Check for that.

Is there any minimum hardware requirement for testing with apache workbench.

Latest Results on Production Server are Are:

APACHE WORKBENCH RESULT WITH APC IMPLEMENTATION (LIVE SERVER)

[root@localhost Desktop]# ab -n 10 -c 5 http://www.mywebsite.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 www.mywebsite.com (be patient)…done

Server Software: Apache/2.2.15

Server Hostname: www.mywebsite.com

Server Port: 80

Document Path: /

Document Length: 49439 bytes

Concurrency Level: 5

Time taken for tests: 5.893 seconds

Complete requests: 10

Failed requests: 0

Write errors: 0

Total transferred: 527410 bytes

HTML transferred: 522538 bytes

Requests per second: 1.70 [#/sec] (mean)

Time per request: 2946.266 [ms] (mean)

Time per request: 589.253 [ms] (mean, across all concurrent requests)

Transfer rate: 87.41 [Kbytes/sec] received

Connection Times (ms)

          min  mean[+/-sd] median   max

Connect: 333 343 4.5 343 351

Processing: 1380 2115 1053.9 1707 4145

Waiting: 653 937 216.9 982 1300

Total: 1722 2457 1054.7 2041 4490

Percentage of the requests served within a certain time (ms)

50% 2041

66% 2216

75% 2376

80% 4352

90% 4490

95% 4490

98% 4490

99% 4490

100% 4490 (longest request)

APACHE WORKBENCH RESULT WITHOUT APC IMPLEMENTATION (LIVE SERVER)

[root@localhost Desktop]# ab -n 10 -c 5 http://www.mywebsite.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 www.mywebsite.com (be patient)…done

Server Software: Apache/2.2.15

Server Hostname: www.mywebsite.com

Server Port: 80

Document Path: /

Document Length: 49439 bytes

Concurrency Level: 5

Time taken for tests: 9.206 seconds

Complete requests: 10

Failed requests: 0

Write errors: 0

Total transferred: 498450 bytes

HTML transferred: 494390 bytes

Requests per second: 1.09 [#/sec] (mean)

Time per request: 4602.845 [ms] (mean)

Time per request: 920.569 [ms] (mean, across all concurrent requests)

Transfer rate: 52.88 [Kbytes/sec] received

Connection Times (ms)

          min  mean[+/-sd] median   max

Connect: 333 339 4.2 339 346

Processing: 1952 3423 1131.6 3442 5279

Waiting: 1208 2184 670.0 2720 2817

Total: 2284 3762 1132.0 3777 5617

Percentage of the requests served within a certain time (ms)

50% 3777

66% 3815

75% 4268

80% 5580

90% 5617

95% 5617

98% 5617

99% 5617

100% 5617 (longest request)

No. But your production system is showing really odd numbers: Less than 2 requests per second is really, really slow.