Open for Voting

Parameterize the amount of memory allowed for S1-created Extended Events Sessions to avoid/fix error 25747

In Azure SQL Database "Servers", there is a limit on how much memory is allowed to be consumed by Extended Events Sessions, Because S1 creates all sessions with a fixed amount of memory, this effectively caps the number of Azure SQL Databases that can be monitored within a single Azure SQL Database "Server", It seems that there is one EE Session created in each database by each Monitoring Service, lowering the cap even further depending on how many Monitoring Services are running,

At the very least, we need a configurable value for how much memory should be allowed for each created EE Session. Currently each session is created with MAX_MEMORY=3072 KB. If I want to have more databases in an Azure SQL Database "Server", I need to set that lower. I don't want to have to set that manually by editing each session in each database, so there needs to be a way to have a change to that parameter trigger update the memory option for all the EE Sessions to use the new parameter. Ideally, this would be configurable per "Server", once you support Azure SQL Database "Servers" in any way at all. That way I only have to change the value when I start getting errors.

This is to avoid the error 25747: Operation failed. Operation will cause database event session memory to exceed allowed limit. Event session memory may be released by stopping active sessions or altering session memory options. Check sys.dm_xe_database_sessions for active sessions that can be stopped or altered. If no sessions are active on this database, please check sessions running on other databases under the same logical server.