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

Set the default thread pool size based on number of cores in the system

Open rishabhpoddar opened this issue 3 years ago • 2 comments

  • Also consider number of virtual cores?
  • Does this affect the db connection pool size as well?

rishabhpoddar avatar Jul 27 '21 04:07 rishabhpoddar

setting based on number of cores would lead to oversizing the DB connection pool size. DB connection pool size is to be configured based on connection usage, which is dependent on active-number of users.

videvelop avatar Oct 12 '21 00:10 videvelop

So this is the setting of the connection pool size on each core instance. We use apache tomcat, which means that each request is served on a new thread. The size of that thread pool should be = to the number of (virtual) cores in the system. Since each request uses just one connection to the db, it then implies that the connection pool size should also be equal to the number of (virtual) cores.

Would this be accurtate? Or am I missing something? :)

rishabhpoddar avatar Oct 12 '21 05:10 rishabhpoddar