Service Broker takes long time to insert into a table

  • Lots of pieces missing here. You say that the procedure completes in 13 seconds, and then there are INSERTs going on six hours later.

    Should I guess that the procedure you talk about post messages on Service Broker queues, and then there is an activation procedure which processes the messages?

    I would guess then that the activation procedure needs tuning.

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]

  • Yes the inserts takes 6 hours to complete.

    Basically I want to know how to use more than 1 dialog to make use of parallel processing.

    Sanz
  • You change a MAX_QUEUE_READERS parameter to start more activation procedures.

    http://technet.microsoft.com/en-us/library/ms189529.aspx

    But are you sure that it will speed up and actication proc don't need a tuning?

  • We have tuned the procedure now. It is being serially processed now. We need parallelism, and for that I believe we need more than one dialog. Not sure how to create more dialog.

    Sanz
  • Sanz (9/5/2013)


    We have tuned the procedure now. It is being serially processed now. We need parallelism, and for that I believe we need more than one dialog. Not sure how to create more dialog.

    Since I know next to nothing about your system, I can't how you can get more dialogs. However, as e4d4 said, you can change to the queue to have more readers. Be aware, though, that having multiple queue readers means that you cannot save data between messages, particularly not if you roll back and make a new attempt, because another queue reader may get the message.

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]

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

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