Question regarding mdf and ldf file on a separate drives.

  • I have a small DB 30GB, share 1 disk drive for data file and log file. I usually see a high WRITERLOG wait time so I was thinking maybe putting the log file on a separate drive. I just need to know if it will help if we are running in virtual environment. I mean putting a log file on a separate Physical drive will definitely help but what happens if it's a virtual environment?

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • It depends on how your virtual environment is set up and managed. Many of them use physical storage, not virtual storage. In fact, a pretty hefty percentage are set up this way. So, in theory, your two drives are literally two drives. If they are not, it might make very little to no difference. Talk to your SAN admins to find out how the disks are configured before you make the change.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey (12/10/2014)


    It depends on how your virtual environment is set up and managed. Many of them use physical storage, not virtual storage. In fact, a pretty hefty percentage are set up this way. So, in theory, your two drives are literally two drives. If they are not, it might make very little to no difference. Talk to your SAN admins to find out how the disks are configured before you make the change.

    They are not 2 separate drives in our environment, so it won’t make any difference. What can be the other solution?

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • New Born DBA (12/16/2014)


    Grant Fritchey (12/10/2014)


    It depends on how your virtual environment is set up and managed. Many of them use physical storage, not virtual storage. In fact, a pretty hefty percentage are set up this way. So, in theory, your two drives are literally two drives. If they are not, it might make very little to no difference. Talk to your SAN admins to find out how the disks are configured before you make the change.

    They are not 2 separate drives in our environment, so it won’t make any difference. What can be the other solution?

    That's a physical limitation. You can only write so fast to a single disk drive and if that's a shared drive between your OS, your data, your log, your tempdb.... that's going to lead to physical constraints. The way around it is to break things apart.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • I also ran this script to find waits. Please see the attachment, result from the script.

    WITH [Waits] AS

    (SELECT

    [wait_type],

    [wait_time_ms] / 1000.0 AS [WaitS],

    ([wait_time_ms] - [signal_wait_time_ms]) / 1000.0 AS [ResourceS],

    [signal_wait_time_ms] / 1000.0 AS [SignalS],

    [waiting_tasks_count] AS [WaitCount],

    100.0 * [wait_time_ms] / SUM ([wait_time_ms]) OVER() AS [Percentage],

    ROW_NUMBER() OVER(ORDER BY [wait_time_ms] DESC) AS [RowNum]

    FROM sys.dm_os_wait_stats

    WHERE [wait_type] NOT IN (

    N'BROKER_EVENTHANDLER', N'BROKER_RECEIVE_WAITFOR',

    N'BROKER_TASK_STOP', N'BROKER_TO_FLUSH',

    N'BROKER_TRANSMITTER', N'CHECKPOINT_QUEUE',

    N'CHKPT', N'CLR_AUTO_EVENT',

    N'CLR_MANUAL_EVENT', N'CLR_SEMAPHORE',

    N'DBMIRROR_DBM_EVENT', N'DBMIRROR_EVENTS_QUEUE',

    N'DBMIRROR_WORKER_QUEUE', N'DBMIRRORING_CMD',

    N'DIRTY_PAGE_POLL', N'DISPATCHER_QUEUE_SEMAPHORE',

    N'EXECSYNC', N'FSAGENT',

    N'FT_IFTS_SCHEDULER_IDLE_WAIT', N'FT_IFTSHC_MUTEX',

    N'HADR_CLUSAPI_CALL', N'HADR_FILESTREAM_IOMGR_IOCOMPLETION',

    N'HADR_LOGCAPTURE_WAIT', N'HADR_NOTIFICATION_DEQUEUE',

    N'HADR_TIMER_TASK', N'HADR_WORK_QUEUE',

    N'KSOURCE_WAKEUP', N'LAZYWRITER_SLEEP',

    N'LOGMGR_QUEUE', N'ONDEMAND_TASK_QUEUE',

    N'PWAIT_ALL_COMPONENTS_INITIALIZED',

    N'QDS_PERSIST_TASK_MAIN_LOOP_SLEEP',

    N'QDS_CLEANUP_STALE_QUERIES_TASK_MAIN_LOOP_SLEEP',

    N'REQUEST_FOR_DEADLOCK_SEARCH', N'RESOURCE_QUEUE',

    N'SERVER_IDLE_CHECK', N'SLEEP_BPOOL_FLUSH',

    N'SLEEP_DBSTARTUP', N'SLEEP_DCOMSTARTUP',

    N'SLEEP_MASTERDBREADY', N'SLEEP_MASTERMDREADY',

    N'SLEEP_MASTERUPGRADED', N'SLEEP_MSDBSTARTUP',

    N'SLEEP_SYSTEMTASK', N'SLEEP_TASK',

    N'SLEEP_TEMPDBSTARTUP', N'SNI_HTTP_ACCEPT',

    N'SP_SERVER_DIAGNOSTICS_SLEEP', N'SQLTRACE_BUFFER_FLUSH',

    N'SQLTRACE_INCREMENTAL_FLUSH_SLEEP',

    N'SQLTRACE_WAIT_ENTRIES', N'WAIT_FOR_RESULTS',

    N'WAITFOR', N'WAITFOR_TASKSHUTDOWN',

    N'WAIT_XTP_HOST_WAIT', N'WAIT_XTP_OFFLINE_CKPT_NEW_LOG',

    N'WAIT_XTP_CKPT_CLOSE', N'XE_DISPATCHER_JOIN',

    N'XE_DISPATCHER_WAIT', N'XE_TIMER_EVENT')

    AND [waiting_tasks_count] > 0

    )

    SELECT

    MAX ([W1].[wait_type]) AS [WaitType],

    CAST (MAX ([W1].[WaitS]) AS DECIMAL (16,2)) AS [Wait_S],

    CAST (MAX ([W1].[ResourceS]) AS DECIMAL (16,2)) AS [Resource_S],

    CAST (MAX ([W1].[SignalS]) AS DECIMAL (16,2)) AS [Signal_S],

    MAX ([W1].[WaitCount]) AS [WaitCount],

    CAST (MAX ([W1].[Percentage]) AS DECIMAL (5,2)) AS [Percentage],

    CAST ((MAX ([W1].[WaitS]) / MAX ([W1].[WaitCount])) AS DECIMAL (16,4)) AS [AvgWait_S],

    CAST ((MAX ([W1].[ResourceS]) / MAX ([W1].[WaitCount])) AS DECIMAL (16,4)) AS [AvgRes_S],

    CAST ((MAX ([W1].[SignalS]) / MAX ([W1].[WaitCount])) AS DECIMAL (16,4)) AS [AvgSig_S]

    FROM [Waits] AS [W1]

    INNER JOIN [Waits] AS [W2]

    ON [W2].[RowNum] <= [W1].[RowNum]

    GROUP BY [W1].[RowNum]

    HAVING SUM ([W2].[Percentage]) - MAX ([W1].[Percentage]) < 95; -- percentage threshold

    GO

    "He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]

  • Yes, you need separate physical drives.

    Smaller, cheaper drives very often work better than a single, more expensive drive. For I/O, the number of spindles is more critical than the drive speed.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply