square.
IIS Worker (30%) and SQL Server (60%) High CPU usage.
thank you so much for this lol, i think i found what was spiking usage. i just kept spamming f12 till i got to a piece of code that just kept generating an 8 character unique random string but the code's been running long enough with enough users that most of the strings have been used so it just started looping till it found one of the few strings that havent been accomodated yet. just increased the string length to 12 and the cpu usage went from 98% peak to 5% lmao.
11 replies
IIS Worker (30%) and SQL Server (60%) High CPU usage.
i don't see how select n+1 could manifest in the type of queries that are currently being run, most if not all are pk lookups and are not nested lookups, and largest result set so far is over 18 rows for a single query. Is this visible via the script found in this link https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/performance/troubleshoot-high-cpu-usage-issues ? the main query that's popping off in the diagnostic script's result set is this though,
SELECT CASE WHEN EXISTS( SELECT 1 FROM dbo.Table WHERE Id = @Id ) THEN CAST(1 as bit) ELSE CAST(0 as bit) END
. and i can only surmise that it's the result of an orm operation because of how the command text was written. Problem is i don't really have a query that explicitly does this, so i can't tell which endpoint exactly is firing it.11 replies