-
Notifications
You must be signed in to change notification settings - Fork 14
Performance issues #1
Comments
Hi,
Welcome! I had to develop this fork as original repo had a lot of confusions that I though need to be fixed.
I would suggest few tests to find out the bottleneck:
Let me know of the results for further ideas. |
Hi
Tested, similar time response
I'll do it, assumig that
I'll tested. What about the storage modes I mentioned earlier?? I'll tell you my results. Thanks |
Did you remove all JWT configurations?
I don't think they will be of any value. I might be wrong though. My suspects are JWT specific parts |
I managed to improve time responses taking theses steps:
Yet, the token issuance take 800ms aprox, and resource request 500ms to 700ms aprox. By experience, this should be faster to feed a SPA client. Changing to HS256 didn't make any inprovements I have now JWT issuance, but I have one question (besides the obvious one, that is, how to improve performance even more) ...... where JWT are stored?? They are not in DB. Best regards. |
Why would you store JWT on database? They are self contained A |
Also what other libraries that offer same functionalities measure up other than mentioned .Net in terms of latency? |
As a favor can you help document what you have done exactly on the Wiki to help others who would face same issue? Even a comment here should be enough! |
My mistake. Wrong question, I forgot the self-contained feature of JWT ... I was thnking wrong, it was too late in night after all
I'll be glad, after the help you gave me. Please tell what specific knowledge you want me to share. One question. ¿Does the library have a feature to extract token claims? |
@jonmunm you can extract it in two ways
public static function findIdentityByAccessToken($token, $type = null)
{
$pubKeyStorage = Yii::$container->get('public_key');
$algo = $pubKeyStorage->getEncryptionAlgorithm();
$pubKey = $pubKeyStorage->getPublicKey();
$decoded = \Firebase\JWT\JWT::decode($token, $pubKey,[$algo]);
echo json_encode(['token'=>$decoded]); die();
//return null;
}
public static function findIdentityByAccessToken($token, $type = null)
{
$accessToken = Yii::$container->get('access_token');
echo json_encode(['token'=>$accessToken->getAccessToken($token)]); die();
//return null;
} So choice is yours |
Users of the library are likely to hit the performance issue that you found yourself in. Refer your comment here:
Here is where I need to know exactly which logging and debug features you disabled |
First of all, thanks. I take your option changing de repo since the previous gave many errors.
Some points:
'public_key' => 'app\storage\PublicKeyStorage'
, but the class is namespaced withnamespace app\security\storage;
Here the thing. I've been doing some performance debug with Google Chrome and noted that token issuance take some long time (compare with other implementations I've made with .NET)
After perform many request at the token endpoint, the minimun take 1.86s and the maximun 2.3s (in .NET this take 200ms aprox).
Then, when I tried to access a protected resource in my api, this also take a long time. My resource endpoint doesn't perform query operations (to discard this variable) in order to isolate the token verification process time.
The time of this was: maximun -> 2.5s, minimun 1.8s
I'll be thankfull if you can light me in the right direction to get better performance. My server is an Ububntu Server. Perphabs if I change the storage modes like pointed in http://bshaffer.github.io/oauth2-server-php-docs/storage/multiple/
I would like a scheman like this:
Best regards
Jona
The text was updated successfully, but these errors were encountered: