supertokens-node icon indicating copy to clipboard operation
supertokens-node copied to clipboard

Use keepAlive: true in axios calls

Open bhumilsarvaiya opened this issue 5 years ago • 0 comments

the way we use axios in our supertokens node library, it will not perform well under heavy load.. each axios call will try to establish a TCP connection to the server where supertokens core is running. It would be better idea to create an axios object with keepAlive: true (which will keep the TCP connection alive even after request is over and any successive request to supertokens core server, it will not spend time in making TCP connection, nor using up any extra TCP socket which can be used to serve more incoming requests and the response time will be significantly better)

bhumilsarvaiya avatar Oct 28 '20 08:10 bhumilsarvaiya