Every call of UserManager.GetUserAsync allocates one connection to postgresql database and doesn't release it. Such action increase connection pool by 1 every time I call it.
public async Task<IActionResult> Test() { var currentUser = await _userManager.GetUserAsync(HttpContext.User); return Ok(currentUser); }
You can control number of the opened connection using SQL:
SELECT * FROM pg_stat_activity
When I do this 100+ times I get fatal error "FATAL: sorry, too many clients already". It happens when DBMS configured by default on my windows platform.
I also noticed that call of GetUserAsync doesn't make any SQL calls into database but opens new connection.
Every call of UserManager.GetUserAsync allocates one connection to postgresql database and doesn't release it. Such action increase connection pool by 1 every time I call it.
public async Task<IActionResult> Test() { var currentUser = await _userManager.GetUserAsync(HttpContext.User); return Ok(currentUser); }You can control number of the opened connection using SQL:
SELECT * FROM pg_stat_activityWhen I do this 100+ times I get fatal error "FATAL: sorry, too many clients already". It happens when DBMS configured by default on my windows platform.
I also noticed that call of GetUserAsync doesn't make any SQL calls into database but opens new connection.