Этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
Политика конфиденциальности
|
|
|
MS SQL cъедает больше памяти, чем ему положено.
|
|||
|---|---|---|---|
|
#18+
Наконец-то дошло проверить типа страниц, за которые идет конкуренция. Мониторил через запрос Код: sql 1. 2. 3. 4. 5. 6. Потом проверялв этом запросе по их PAGE_INDEX. Код: sql 1. 2. 3. 4. 5. 6. 7. Все страницы были типа PFS в TempDB. Из всех источников рекомендации были только увеличить кол-во файлов TempDB, что мне лично при эксперименте не помогло. Это единственный вариант? Куда и что еще посмотреть? p.s. В базе активно юзается импорт из xml, данные заливаются постоянно с высокой частотой, но объем данных небольшой. Использую OPENXML. После выгрузки данных во времянку сразу же делаю sp_xml_removedocument. Потом эти же данные постоянно запрашиваются в нашем ПО для мониторинга менеджерами(web-страница, открыта постоянно и постоянно обновляется). Вечером, когда нагрузка ниже(меньше менеджеров работает), проблем с блокировками практически не наблюдается. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.02.2018, 11:13 |
|
||
|
MS SQL cъедает больше памяти, чем ему положено.
|
|||
|---|---|---|---|
|
#18+
MegabyteВсе страницы были типа PFS в TempDB. Из всех источников рекомендации были только увеличить кол-во файлов TempDB, что мне лично при эксперименте не помогло. Это единственный вариант? Куда и что еще посмотреть? Troubleshooting: Tempdb Contention RandalThere are three things you can do to alleviate this kind of contention and increase the throughput of the overall workload: Stop using temp tables Enable trace flag 1118 as a start-up trace flag Create multiple tempdb data files + Misconceptions around TF 1118 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.02.2018, 12:36 |
|
||
|
MS SQL cъедает больше памяти, чем ему положено.
|
|||
|---|---|---|---|
|
#18+
MegabyteЕсли вдруг кому будет интересно, напишу, что делал. 1) Добавление файлов tempDb до 4шт на 4 процессора, как по рекомендации Микрософт, ничего не дало. 1 шт. не на процессор, а на физическое ядро, до 8 шт не задумываясь, если больше то нужно смотреть.(даже на одном и том же диске) авторRecommendations to reduce allocation contention in SQL Server tempdb database Symptoms You observe severe blocking when the SQL Server is experiencing heavy load. When you examine the Dynamic Management Views [sys.dm_exec_request or sys.dm_os_waiting_tasks], you observe that these requests or tasks are waiting for tempdb resources. Additionally, you will notice that the wait type is PAGELATCH_UP and wait resource points to pages in tempdb. These pages might be of the format 2:1:1, 2:1:3 and so on (PFS and SGAM pages in tempdb). Note If a page is evenly-divisible by 8088, then it is a PFS page. For example, page 2:3:905856 is a PFS in file_id=3 in tempdb. Cause When the tempdb database is heavily used, SQL Server may experience contention when it tries to allocate pages. Depending on the degree of contention, this may cause queries and requests that involve tempdb to be unresponsive for short periods of time. Resolution There are several steps you can take to improve the concurrency of tempdb: As a general rule, if the number of logical processors is less than or equal to 8, use the same number of data files as logical processors. If the number of logical processors is greater than 8, use 8 data files and then if contention continues, increase the number of data files by multiples of 4 (up to the number of logical processors) until the contention is reduced to acceptable levels or make changes to the workload/code. Consider implementing the best practice recommendations in the Technet article titled Working with tempdb in SQL Server 2005. If the previous steps do not significantly reduce the allocation contention and the contention is on SGAM pages, implement trace flag -T1118. Under this trace flag, SQL Server allocates full extents to each database object, thereby eliminating the contention on SGAM pages. Note that this trace flag affects every database on the instance of SQL Server. For information about how to determine whether the allocation contention is on SGAM pages, see Monitoring contention caused by DML operations subtopic under Working with tempdb in SQL Server 2005 page on Technet. Starting with SQL Server 2016, some of these configuration changes are automatic and do not need user intervention. For more information инсталятор SQL сам создает теперь несколько файлов tempdb . ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.02.2018, 12:50 |
|
||
|
MS SQL cъедает больше памяти, чем ему положено.
|
|||
|---|---|---|---|
|
#18+
архивариусMegabyteЕсли вдруг кому будет интересно, напишу, что делал. 1) Добавление файлов tempDb до 4шт на 4 процессора, как по рекомендации Микрософт, ничего не дало. 1 шт. не на процессор, а на физическое ядро, до 8 шт не задумываясь, если больше то нужно смотреть.(даже на одном и том же диске) авторRecommendations to reduce allocation contention in SQL Server tempdb database Symptoms You observe severe blocking when the SQL Server is experiencing heavy load. When you examine the Dynamic Management Views [sys.dm_exec_request or sys.dm_os_waiting_tasks], you observe that these requests or tasks are waiting for tempdb resources. Additionally, you will notice that the wait type is PAGELATCH_UP and wait resource points to pages in tempdb. These pages might be of the format 2:1:1, 2:1:3 and so on (PFS and SGAM pages in tempdb). Note If a page is evenly-divisible by 8088, then it is a PFS page. For example, page 2:3:905856 is a PFS in file_id=3 in tempdb. Cause When the tempdb database is heavily used, SQL Server may experience contention when it tries to allocate pages. Depending on the degree of contention, this may cause queries and requests that involve tempdb to be unresponsive for short periods of time. Resolution There are several steps you can take to improve the concurrency of tempdb: As a general rule, if the number of logical processors is less than or equal to 8, use the same number of data files as logical processors. If the number of logical processors is greater than 8, use 8 data files and then if contention continues, increase the number of data files by multiples of 4 (up to the number of logical processors) until the contention is reduced to acceptable levels or make changes to the workload/code. Consider implementing the best practice recommendations in the Technet article titled Working with tempdb in SQL Server 2005. If the previous steps do not significantly reduce the allocation contention and the contention is on SGAM pages, implement trace flag -T1118. Under this trace flag, SQL Server allocates full extents to each database object, thereby eliminating the contention on SGAM pages. Note that this trace flag affects every database on the instance of SQL Server. For information about how to determine whether the allocation contention is on SGAM pages, see Monitoring contention caused by DML operations subtopic under Working with tempdb in SQL Server 2005 page on Technet. Starting with SQL Server 2016, some of these configuration changes are automatic and do not need user intervention. For more information инсталятор SQL сам создает теперь несколько файлов tempdb . Мы пока на 2008м, правда скоро планируем апгрейд. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.02.2018, 15:30 |
|
||
|
MS SQL cъедает больше памяти, чем ему положено.
|
|||
|---|---|---|---|
|
#18+
архивариусMegabyteЕсли вдруг кому будет интересно, напишу, что делал. 1) Добавление файлов tempDb до 4шт на 4 процессора, как по рекомендации Микрософт, ничего не дало. 1 шт. не на процессор, а на физическое ядро, до 8 шт не задумываясь, если больше то нужно смотреть.(даже на одном и том же диске) У нас сервера на виртуалках. Под проблемный сервер выделено 4 ядра. Т.е. таки 4 файла, минимум, делать? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.02.2018, 15:49 |
|
||
|
MS SQL cъедает больше памяти, чем ему положено.
|
|||
|---|---|---|---|
|
#18+
Megabyteархивариуспропущено... 1 шт. не на процессор, а на физическое ядро, до 8 шт не задумываясь, если больше то нужно смотреть.(даже на одном и том же диске) У нас сервера на виртуалках. Под проблемный сервер выделено 4 ядра. Т.е. таки 4 файла, минимум, делать? слушайте, а вообще есть ли смысл вам отвечать? выше приведена ссылка на Рэндала, про кол-во файлов там четко написано, но наверное, лучше всем миром проголосовать? автор#3 ( Create multiple tempdb data files) will help to remove the PFS page contention, by spreading the allocation workload over multiple files, thus reducing contention on the individual, per-file PFS pages. But how many data files should you create? The best guidance I’ve seen is from a great friend of mine, Bob Ward, who’s the top Escalation Engineer in Microsoft SQL Product Support. Figure out the number of logical processor cores you have (e.g. two CPUS, with 4 physical cores each, plus hyperthreading enabled = 2 (cpus) x 4 (cores) x 2 (hyperthreading) = 16 logical cores. Then if you have less than 8 logical cores, create the same number of data files as logical cores. If you have more than 8 logical cores, create 8 data files and then add more in chunks of 4 if you still see PFS contention. Make sure all the tempdb data files are the same size too. (This advice is now official Microsoft guidance in KB article 2154845.) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.02.2018, 16:01 |
|
||
|
MS SQL cъедает больше памяти, чем ему положено.
|
|||
|---|---|---|---|
|
#18+
Yasha123Megabyteпропущено... У нас сервера на виртуалках. Под проблемный сервер выделено 4 ядра. Т.е. таки 4 файла, минимум, делать? слушайте, а вообще есть ли смысл вам отвечать? выше приведена ссылка на Рэндала, про кол-во файлов там четко написано, но наверное, лучше всем миром проголосовать? автор#3 ( Create multiple tempdb data files) will help to remove the PFS page contention, by spreading the allocation workload over multiple files, thus reducing contention on the individual, per-file PFS pages. But how many data files should you create? The best guidance I’ve seen is from a great friend of mine, Bob Ward, who’s the top Escalation Engineer in Microsoft SQL Product Support. Figure out the number of logical processor cores you have (e.g. two CPUS, with 4 physical cores each, plus hyperthreading enabled = 2 (cpus) x 4 (cores) x 2 (hyperthreading) = 16 logical cores. Then if you have less than 8 logical cores, create the same number of data files as logical cores. If you have more than 8 logical cores, create 8 data files and then add more in chunks of 4 if you still see PFS contention. Make sure all the tempdb data files are the same size too. (This advice is now official Microsoft guidance in KB article 2154845.) Я к чему спрашивал, может есть какие-то различия для виртуалок... Статью Рэндала читал и даже делал уже 4 файла: на кол-во блокировок это не особо повлияло. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 09.02.2018, 10:12 |
|
||
|
MS SQL cъедает больше памяти, чем ему положено.
|
|||
|---|---|---|---|
|
#18+
Хочу включить флаг трассировки при запуске. Добавляю в параметры запуска: "-dC:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\master.mdf;-eC:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG;-lC:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\mastlog.ldf; -T1118" Перегружаю службу. Проверяю: Код: sql 1. Результат: TraceFlag Status Global Session 1118 0 0 0 Подскажите, почему флаг не активируется? Что не так делаю? При активации скриптом: Код: sql 1. Результат виден: TraceFlag Status Global Session 1118 1 1 0 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.02.2018, 12:53 |
|
||
|
MS SQL cъедает больше памяти, чем ему положено.
|
|||
|---|---|---|---|
|
#18+
Народ, ну подскажите, что не так делаю? Настройку делаю по статьям: https://technet.microsoft.com/ru-ru/library/ms190699(v=sql.105).aspx https://toster.ru/q/264853 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.02.2018, 14:43 |
|
||
|
|

start [/forum/topic.php?fid=46&msg=39599115&tid=1690244]: |
0ms |
get settings: |
8ms |
get forum list: |
20ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
69ms |
get topic data: |
13ms |
get forum data: |
3ms |
get page messages: |
73ms |
get tp. blocked users: |
2ms |
| others: | 252ms |
| total: | 448ms |

| 0 / 0 |
