Is the optimisations use async session write option still necessary 2.6+

Hi

I’m still using "optimisations_use_async_session_write": false due to a JSVM plugin of ours that is manually doing calls to TykGetKeyData,TykMakeHttpRequest, TykSetKeyData

Originally in development back in the pre 2.5 days this was set to optimisations_use_async_session_write: true but we experienced session lookup misses when in fact the session was there (some race condition) described in this thread

Is the use of "optimisations_use_async_session_write": false still necessary for this scenario post 2.6+?

Hello!

Yes, it still necessary, since your plugin rely on session state.

Maybe the right way of fixing the issue, will be making TykSetKeyData always act synchronously (unless you depend on session changes made outside your plugin)

Does it makes sense?

Not totally following, how do I make TykSetKeyData behave synchronously, beyond setting optimisations_use_async_session_write? I was under the assumption it was already writing in band given that setting.

The original reason we set this is that we are managing the session ourself, then telling tyk via a custom header which key to leverage in its auth plugin. (we create the session key) This was leading to some sort of race condition by which the tyk auth plugin was not seeing the updated key.

Would love to be able to get rid of this (full sync) because I think its affecting performance in some instances.

Are you sure that performance issues coming from optimisations_use_async_session_write?
Can you share average RPS which your instance receive, and its CPU utilization?

Do you have close_connections: true in your config, or proxy_close_connections?

We also just release performance focused release Tyk 2.7: An API Gateway Odyssey - Tyk API Gateway, will be nice to see your results after upgrade!

Hope it helps.