Improve message throughput of MSMQ through memory disks

Source: Internet
Author: User
Tags msmq

Since MSMQ message interaction requires read and write operations on disks, a relatively effective method to improve MSMQ message throughput is to improve disk read and write capabilities. you can simply store MSMQ messages, logs, and other files to different disks to reduce MSMQ's I/O dependency on a disk and achieve higher read/write efficiency. because MSMQ is generally used to store stream data, it is a good option to store MSMQ in memory if the message structure is small and the consumption accumulation is low, in this way, the Read and Write efficiency of MSMQ can be greatly improved (Disadvantage: Some data is lost when the power is down ). the following are some implementations and simple tests on MSMQ memory storage.

Create a memory disk

First, you need to create a disk from the memory, which can be achieved through some tools. Here we select dataram ramdisk (this tool is free of charge if the space below the virtual 4G ). the memory size to be analyzed depends on the actual situation. The following is a simple analysis of how much memory is needed to build a disk in 2 GB space. if the message you store is not large, and the message stay is not long, it is enough.

After creation, you only need to click the start ramdisk button to generate a memory disk.

Prepare memory disk backup

The risk of completely storing data in the memory is still relatively high. You can write the data on the memory disk into a mirror file according to the actual needs.Dataram ramdisk is a thoughtful tool. It providesThe image file of the data source of the memory disk and the settings for regularly saving the image.

 

Save the image information and set it according to the actual situation.

Change the MSMQ storage path

After the memory disk is built, you only need to direct the MSMQ file storage path to the memory disk.

 

Performance test comparison

After MSMQ is stored on a memory disk, will the overall read/write efficiency be improved? The following is a simple test.

Structure of the Test message:

[Protocontract] public class employee {[protomember (1)] Public String employeeid {Get; set;} [protomember (2)] Public String firstname {Get; set ;} [protomember (3)] Public String lastname {Get; set;} [protomember (4)] Public String title {Get; set;} [protomember (5)] public String address {Get; set;} [protomember (6)] Public String city {Get; set;} [protomember (7)] Public String region {Get; set ;} [protomember (8)] Public String postalcode {Get; set;} [protomember (9)] Public String notes {Get; set;} [protomember (10)] public string extension {Get; set;} [protocontract] public class order {[protomember (1)] Public String orderid {Get; set;} [protomember (2)] public String customerid {Get; set;} [protomember (3)] Public String employeeid {Get; set;} [protomember (4)] public datetime orderdate {Get; set ;} [protomember (5)] public datetime requireddate {Get; set;} [protomember (6)] Public String shipname {Get; set;} [protomember (7)] public String shipaddress {Get; set;} [protomember (8)] Public String shipcity {Get; set;} [protomember (9)] Public String shipregion {Get; set ;} [protomember (10)] Public String shippostalcode {Get; set;} [protomember (11)] Public String shipcountry {Get; set ;}}

General disk test results

 

Memory disk test results

From the test structure, the benefits of memory disks are quite obvious. both receive and send messages are improved by 1/3. because the message size is not large and the waiting time in the queue is not long, after running more than 0.3 billion message scheduling, the memory usage is only 30 mb, there should be no major problems with storing images of memory disks in such a small space for a short period of time. however, memory disks are risky after all. If your business scheduling messages cannot be lost at all, we do not recommend using memory disks for MSMQ storage.

This test result also illustrates a problem. To improve the MSMQ throughput, a disk with high read/write efficiency is very important.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.