Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
adrian01
Starting Member
5 Posts |
Posted - 2012-05-17 : 01:08:32
|
Hi,I am using SQL Server 2005 and .NET applications on mys erver which has been running fine for 3 years. Suddenly yesterday I got notification low disk on my primary C drive. It turned out that my tempdb.mdf grew very large up to 10 GB. We did nothing within these few days (meaning we didn't make any changes to the settings, servers, or applciations)To solve this tempdb problem, this is what I have done:1. Restarted the SQL Server (MSSQLSERVER) from Services. After doing so, the tempdb is back to normal which is 200MB. But within 1 hour it grew back to 10 GB!2. I set the Maximum File Size for the tempdb to 3000 MB, then restarted the SQL Server. Well, this time the tempdb.mdf still grew very fast from 200MB to 3000MB and stop. But another problem arises: it causes error which is then logged into ERRORLOG. Thus, this ERRORLOG file grew up to 8 GB within a few hours.Because those 2 attemps failed, I tried to find out what causes the tempdb to behave this way. This is what I did:- I stopped all my .NET windows applications- I stopped all FTP Sites, Application Pools, Web Sites and Web Service Extensions from the Internet Information Services (IIS) Manager- Then I restarted the SQL Server from ServicesBut the thing is, the tempdb.mdf still grows very fast from 200MB to 10 GB!I run a trace in SQL Server Profiler, and it shows that there is no activity at all!So I can conclude that the this tempdb problem is not caused by any of the applications.I tried to run this T-SQL:SELECT t1.session_id, t1.request_id, t1.task_alloc, t1.task_dealloc, t2.sql_handle, t2.statement_start_offset, t2.statement_end_offset, t2.plan_handleFROM (Select session_id, request_id, SUM(internal_objects_alloc_page_count) AS task_alloc, SUM (internal_objects_dealloc_page_count) AS task_dealloc FROM sys.dm_db_task_space_usage GROUP BY session_id, request_id) AS t1, sys.dm_exec_requests AS t2WHERE t1.session_id = t2.session_id AND (t1.request_id = t2.request_id)ORDER BY t1.task_alloc DESC (Sorry, I could not find a way to paste table here, so I just summarized the important information)And from the result returned only 3 of them that has values in task_alloc:session_id 12 has task_alloc 24744session_id 14 has task_alloc 360session_id 20 has task_alloc 112Then I ran this command:select * from Sys.dm_exec_requests Then this is what I got for those 3 session ids:session_id: 12status: backgroundcommand: BRKR EVENT HNDLRsql_handle: NULLstatement_start_offset: NULLstatement_end_offset: NULLplan_handle: NULLdatabase_id: 1user_id: 1connection_id: NULLblocking_session_id: 0wait_type: BROKER_EVENTHANDLERwait_time: 1046last_wait_type: BROKER_EVENTHANDLERwait_resource: open_transaction_count: 0open_resultset_count: 1transaction_id: 0context_info: NULLpercent_complete: 0estimated_completion_time: 0cpu_time: 60718total_elapsed_time: 0scheduler_id: 0task_address: 0x006D87A8reads: 32writes: 30424logical_reads: 8433857text_size: 4096language: us_englishdate_format: mdydate_first: 7quoted_identifier: 1arithabort: 0ansi_null_dflt_on: 1ansi_defaults: 0ansi_warnings: 1ansi_padding: 1ansi_nulls: 1concat_null_yields_null: 1transaction_isolation_level: 2lock_timeout: -1deadlock_priority: 0row_count: 0prev_error: 0nest_level: 1granted_query_memory: 0executing_managed_code: 0session_id: 14status: backgroundcommand: BRKR TASKsql_handle: NULLstatement_start_offset: NULLstatement_end_offset: NULLplan_handle: NULLdatabase_id: 1user_id: 1connection_id: NULLblocking_session_id: 0wait_type: NULLwait_time: 0last_wait_type: LATCH_EXwait_resource: SERVICE_BROKER_TRANSMISSION_WORKTABLE (00000000)open_transaction_count: 0open_resultset_count: 1transaction_id: 0context_info: NULLpercent_complete: 0estimated_completion_time: 0cpu_time: 2532total_elapsed_time: 0scheduler_id: 1task_address: 0x008CC988reads: 0writes: 0logical_reads: 52584text_size: 4096language: us_englishdate_format: mdydate_first: 7quoted_identifier: 1arithabort: 0ansi_null_dflt_on: 1ansi_defaults: 0ansi_warnings: 1ansi_padding: 1ansi_nulls: 1concat_null_yields_null: 1transaction_isolation_level: 2lock_timeout: -1deadlock_priority: 0row_count: 0prev_error: 0nest_level: 1granted_query_memory: 0executing_managed_code: 0session_id: 20status: backgroundcommand: BRKR TASKsql_handle: NULLstatement_start_offset: NULLstatement_end_offset: NULLplan_handle: NULLdatabase_id: 5user_id: 1connection_id: NULLblocking_session_id: 14wait_type: LATCH_SHwait_time: 0last_wait_type: LATCH_SHwait_resource: SERVICE_BROKER_TRANSMISSION_WORKTABLE (02A06750)open_transaction_count: 0open_resultset_count: 1transaction_id: 0context_info: NULLpercent_complete: 0estimated_completion_time: 0cpu_time: 266625total_elapsed_time: 0scheduler_id: 0task_address: 0x006D8898reads: 108523writes: 132logical_reads: 10875333text_size: 4096language: us_englishdate_format: mdydate_first: 7quoted_identifier: 1arithabort: 0ansi_null_dflt_on: 1ansi_defaults: 0ansi_warnings: 1ansi_padding: 1ansi_nulls: 1concat_null_yields_null: 1transaction_isolation_level: 2lock_timeout: -1deadlock_priority: 0row_count: 0prev_error: 0nest_level: 1granted_query_memory: 0executing_managed_code: 0I noticed that the cpu time, reads, writes and logical reads are high for those 3 session_ids.But I don't have any ideas what are those 3 transactions. Are those the ones causing my tempdb.mdf to grow large out of control?Have any of you experiencing the same problems? Any suggestions or ideas?Any help is appreciated.Thank you!Adrian |
|
Sachin.Nand
2937 Posts |
Posted - 2012-05-17 : 01:52:54
|
Looks like someone tried to play with Service Broker on your server.Check whether Service Broker is currently running on it.After Monday and Tuesday even the calendar says W T F .... |
|
|
adrian01
Starting Member
5 Posts |
Posted - 2012-05-17 : 02:25:10
|
Yes, actually we are using Service Broker for our application.Is it the one causing the problem? We have been using Service Broker for years but never experiencing this problem.I tried runningSELECT TOP 10 * FROM sys.transmission_queuebut it returns empty. |
|
|
Sachin.Nand
2937 Posts |
Posted - 2012-05-17 : 03:47:58
|
I had heard/read sometime back that not closing the dialogs properly causes the tempdb to fill.After Monday and Tuesday even the calendar says W T F .... |
|
|
adrian01
Starting Member
5 Posts |
Posted - 2012-05-17 : 11:24:09
|
Is there any way to check where is the trouble in the Service Broker? |
|
|
prett
Posting Yak Master
212 Posts |
|
adrian01
Starting Member
5 Posts |
Posted - 2012-05-18 : 12:22:35
|
Yes, it is indeed the service broker.select * from sys.conversation_endpoints returns 5,698,396 rows of records! And it took 14 minutes to run the query.I just need to do END CONVERSATION.Thanks all of you who have helped. |
|
|
granuharmot
Starting Member
31 Posts |
Posted - 2014-09-23 : 05:12:56
|
unspammed |
|
|
|
|
|
|
|