Slow lounge link
-
Why does loading the lounge directly via
www.codeproject.com/lounge
take forever while going vai the main page and click on the first lounge message loads instantly?Wout Louwers
I have not noticed this. Seems about the same to me.
-
Why does loading the lounge directly via
www.codeproject.com/lounge
take forever while going vai the main page and click on the first lounge message loads instantly?Wout Louwers
Is it a particular server? (look at the very bottom of the page under the bottom banner - you'll see the server name)
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
-
Is it a particular server? (look at the very bottom of the page under the bottom banner - you'll see the server name)
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
No, it is not the server. But when I go to the lounge and hit 'refresh' the loading of the page takes a lot of time. Sometimes even longr then 30 seconds. And after 30 seconds you get a 'busy server' message. But when I use a permalink and hit refresh, the page loads within 5 seconds.
Wout Louwers
-
Is it a particular server? (look at the very bottom of the page under the bottom banner - you'll see the server name)
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
-
Chris, Ii am not the only one who notices this behaviour: Message from th Lounge[^]. Could it have to do with "SQL parameter sniffing"?
Wout Louwers
We're still trying to find out why the sudden load and unfortunately nothing obvious is sticking it's head up. We're not ignoring - just digging deeply.
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
-
We're still trying to find out why the sudden load and unfortunately nothing obvious is sticking it's head up. We're not ignoring - just digging deeply.
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
Chris, Although I do not know how the site works, I can imagine that the messages for the lounge are loaded by a single stored procedure. And that the same stored procedure is used for loading the lounge main page or loading a permalink to a message in the lounge. If this is how it works, the procedure will have parameters that sometimes have values and sometime are NULL. If this is the case, the stored procedure would need different execution plans for different situations, and that is one thing where MSSQL is not at his best. If you have a test system (with a similar amount of messages) you could test this as follows:
- Run the stored procedure with different situations and look at the execution plan.
- Change the sp. The only thing you have to change is saving it with "with recompile"
- Run the previous situations again and compare the outcomes.
If there are differences you have two options: Add the 'with recompile' to the production systems, or split the single sp in two or more variants so they can have there own execution plans. As mentioned before: I don’t know how your site works. I am only a member who is trying to help.
Wout Louwers
-
Chris, Although I do not know how the site works, I can imagine that the messages for the lounge are loaded by a single stored procedure. And that the same stored procedure is used for loading the lounge main page or loading a permalink to a message in the lounge. If this is how it works, the procedure will have parameters that sometimes have values and sometime are NULL. If this is the case, the stored procedure would need different execution plans for different situations, and that is one thing where MSSQL is not at his best. If you have a test system (with a similar amount of messages) you could test this as follows:
- Run the stored procedure with different situations and look at the execution plan.
- Change the sp. The only thing you have to change is saving it with "with recompile"
- Run the previous situations again and compare the outcomes.
If there are differences you have two options: Add the 'with recompile' to the production systems, or split the single sp in two or more variants so they can have there own execution plans. As mentioned before: I don’t know how your site works. I am only a member who is trying to help.
Wout Louwers
I'll pass these suggestions on. We tend to tune specifically for the core scenarios and typically the exectution plan is sensible (well, sensible after we've wrestled it into submission with index hints). SQL Server is terrible at making guesses sometimes.
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
-
I'll pass these suggestions on. We tend to tune specifically for the core scenarios and typically the exectution plan is sensible (well, sensible after we've wrestled it into submission with index hints). SQL Server is terrible at making guesses sometimes.
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
Chris Maunder wrote:
SQL Server is terrible at making guesses sometimes.
O yes, I know. Thats why you have to split the sp's sometimes. The main sp can still exist, so you doe not have to change other code, but if you let that sp call different sp's, you help SQL to choose its indexes. It is sometimes more simple than working with idex hints.
Wout Louwers
-
Chris Maunder wrote:
SQL Server is terrible at making guesses sometimes.
O yes, I know. Thats why you have to split the sp's sometimes. The main sp can still exist, so you doe not have to change other code, but if you let that sp call different sp's, you help SQL to choose its indexes. It is sometimes more simple than working with idex hints.
Wout Louwers
We think we've solved the proble,. The trick: removing an index. SQL Server can suffer a problem whereby it doesn't have time to evaluate the indexes properly so chooses the wrong one.
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP
-
We think we've solved the proble,. The trick: removing an index. SQL Server can suffer a problem whereby it doesn't have time to evaluate the indexes properly so chooses the wrong one.
cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP