Low perfomance with nodejs library jsrassign

Not applicable

Hi,


We intend to sign our JWT Token using the RS256 algorithm. To that purpose, as a proof of concept, we developed a node module which use the js library jsrassign as a dependency. Our module signs a JWT Token with the RS256 algorithm and return the whole generated token.

We ran the module on a MacBook-Pro(2 GHz Intel Core i5 - 8 GB 1867 MHz LPDDR3). We used the same node version(0.10.32) as Apigee. The execution time was around 180 ms on average. We uploaded the module to Apigee. The execution time was around 10 seconds on average.

In our understanding this time difference seems too large to be normal. Could you help us to understand what it is going on?

Regards,

0 1 298
1 REPLY 1

I don't know what's going on...

It could be that you are on a trial version of Edge Saas. This means you're using shared compute resource. It could just be a matter of competing for time on the shared message processor.

Even if you obtained a commercially-licensed Edge SaaS account, running jsrsasign is going to deliver poor performance, especially under load. JS under trireme is just not appropriate to execute the public/private key signature algorithms required for JWT with RS2565.

I have some good news though - Apigee will soon be releasing a set of JWT policies that will not require a Java callout, nor a JS callout. These will be available to all Edge SaaS customers, whether on free trial accounts, or on paid accounts. They will perform much better than the JS implementation you are currently using.