-
Notifications
You must be signed in to change notification settings - Fork 950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Class that implements MemCache support, MemCache is a prerequisite #608
Open
sandinosaso
wants to merge
1
commit into
bshaffer:develop
Choose a base branch
from
sandinosaso:add-memcache-token-support
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Class that implements MemCache support, MemCache is a prerequisite #608
sandinosaso
wants to merge
1
commit into
bshaffer:develop
from
sandinosaso:add-memcache-token-support
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here is a benchmark first with PDO to a local mysql database, the second the same PDO but MemCache powered 👍 ------------------------------------
Apache Test against api endpoint
1000 request in 100 request step
Results
With PDO Time taken for tests: 16.339 seconds
With MemCache Time taken for tests: 10.778 seconds
------------------------------------
---------------------
With PDO Only
---------------------
ab -n 1000 -c 100 http://localhost/yii/apiv99/resource-server/json/rubros?access_token=363945d473218fcbaa8de0bdcd7d0b00769977ba
This is ApacheBench, Version 2.3 <$Revision: 1638069 $>
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 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
Server Software: Apache/2.4.12
Server Hostname: localhost
Server Port: 80
Document Path: /movistaryii/apiv99/resource-server/json/rubros?access_token=363945d473218fcbaa8de0bdcd7d0b00769977ba
Document Length: 2980 bytes
Concurrency Level: 100
Time taken for tests: 16.339 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 3177000 bytes
HTML transferred: 2980000 bytes
Requests per second: 61.20 [#/sec] (mean)
Time per request: 1633.909 [ms] (mean)
Time per request: 16.339 [ms] (mean, across all concurrent requests)
Transfer rate: 189.88 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 3.9 0 14
Processing: 273 1406 895.1 1134 10112
Waiting: 273 1406 895.0 1134 10111
Total: 273 1408 896.2 1134 10112
Percentage of the requests served within a certain time (ms)
50% 1134
66% 1592
75% 1800
80% 1909
90% 2440
95% 2804
98% 3785
99% 4062
100% 10112 (longest request)
---------------------
With PDO + MemCache
---------------------
sandino@envy:~$ ab -n 1000 -c 100 http://localhost/yii/apiv99/resource-server/json/rubros?access_token=363945d473218fcbaa8de0bdcd7d0b00769977ba
This is ApacheBench, Version 2.3 <$Revision: 1638069 $>
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 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
Server Software: Apache/2.4.12
Server Hostname: localhost
Server Port: 80
Document Path: /movistaryii/apiv99/resource-server/json/rubros?access_token=363945d473218fcbaa8de0bdcd7d0b00769977ba
Document Length: 2980 bytes
Concurrency Level: 100
Time taken for tests: 10.778 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 3177000 bytes
HTML transferred: 2980000 bytes
Requests per second: 92.78 [#/sec] (mean)
Time per request: 1077.785 [ms] (mean)
Time per request: 10.778 [ms] (mean, across all concurrent requests)
Transfer rate: 287.86 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 2.1 0 8
Processing: 162 1049 375.8 1000 2632
Waiting: 158 1049 375.8 999 2632
Total: 165 1050 376.2 1000 2639
Percentage of the requests served within a certain time (ms)
50% 1000
66% 1144
75% 1244
80% 1337
90% 1585
95% 1784
98% 1977
99% 2076
100% 2639 (longest request) |
Hey @sandinosaso! Thank you for your PR.
|
Pinging @sandinosaso on this. Any chance of getting my suggestions implemented? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Guys I want to contribute with this, is a way to use MemCache to store your access token, this way the speed up is up to 2 times better than using PDO like mysql. I have used it for at least 1 year in a production server and it works like a charm :), we did comparasion test using apache benchmark only asking for already stored access token on mysql and the times are much better using memcache.
The good thing about it is that it does not matter which Storage you choose you can use anyone of the existing ones in oauth2-server and use MemCache with it.
To use it, an example: