博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
azure之MSSQL服务性能测试
阅读量:6931 次
发布时间:2019-06-27

本文共 4122 字,大约阅读时间需要 13 分钟。

        azure给我们提供非常多的服务而这些服务可以让企业轻而易举地在上构建一个健壮的服务体系.但在使用azure的相关产品服务时还是应该对相关的服务有一些简单的性能了解才能更好的让企业购买适合自己的服务产品.MSSQL是azure提供的一个服务产品之一,它提供了多个性能等级给用户选择,但在一些性能描述上很让你有所理解;下面通过简单的测试看一下azure上的MMSQL针对企业的几个等级P1,P2和P3的并发处理能力.

测试用例

        测试针对Northwind的数据库进行压力测试,具体测试用例如下:

  • 随机获取订单和相关明细
    int i =  System.Threading.Interlocked.Increment(ref mIndex)%mOrderids.Count;            int orderid = mOrderids[i];            (Model.Orders.orderID == orderid).ListFirst
    (cc); if (DB == Peanut.DB.DB2 || DB == Peanut.DB.DB3) { using (Peanut.DBContext.ChangeTable
    ("`Order Details`")) { (Model.OrderDetails.orderID == orderid).List
    (cc); } } else { (Model.OrderDetails.orderID == orderid).List
    (cc); }
  • 添加雇员
    string id = Guid.NewGuid().ToString("N");            Model.Employees item = new Model.Employees();            item.Address = "gz"+id;            item.City = "gz";            item.Country = "cn";            item.Region = "gd";            item.Title = "程序员";            item.BirthDate = DateTime.Now.AddYears(-10);            item.HireDate = item.BirthDate.AddDays(20) ;            item.FirstName = "fan";            item.LastName = "henry";            item.Notes = id;            item.Save(cc);
  • 获取客户订单的TOP 10
    int i = System.Threading.Interlocked.Increment(ref mIndex) % mCustomers.Count;            string customerid = mCustomers[i];            Peanut.SQL SQL;            if (DB == Peanut.DB.DB2 || DB == Peanut.DB.DB3)            {                SQL = "select * from northwind.Orders where customerid=@p1 limit 0,10";            }            else            {                SQL = "select top 10 * from Orders where customerid=@p1";            }            SQL["p1", customerid].List
    (cc);
  • 添加订单和明细(事务)
    Orders order = new Orders();                order.EmployeeID = mEmployeesID[mEmployeeIndex % mEmployeesID.Count];                order.CustomerID = mCustomersID[mCustomerIndex % mCustomersID.Count];                order.ShipVia = mShippers[mShippersIndex % mShippers.Count];                order.Freight = 94.5m;                order.OrderDate = mOrderDateTime[mOrderDateTimeIndex % mOrderDateTime.Count];                order.RequiredDate = order.OrderDate.AddDays(30);                order.ShippedDate = order.OrderDate.AddDays(30);                order.ShipAddress = "gz ld";                order.ShipCity = "gz";                order.ShipCountry = "cn";                order.ShipName = "sdfsdf";                order.ShipPostalCode = "510500";                order.ShipRegion = "gd";                order.Save(cc);                int orderid = sql.GetValue
    (cc); int items = mDetails[mDetailsIndex % mDetails.Count]; int pindex = mProductIndex; for (int i = 0; i < items; i++) { pindex++; Products product = mProducts[pindex % mProducts.Count]; OrderDetails detail = new OrderDetails(); detail.OrderID = orderid; detail.ProductID = product.ProductID; detail.Quantity = 5; detail.UnitPrice = product.UnitPrice; detail.Discount = 0.8; if (DB == Peanut.DB.DB2 || DB == Peanut.DB.DB3) { using (Peanut.DBContext.ChangeTable
    ("`Order Details`")) { detail.Save(cc); } } else { detail.Save(cc); } } cc.Commit();

测试结果

  • P1
  • P2
  • P3

总结

        从测试结果来看对于普通应用来说是足够的,不过针对一些相对来说并发有点高的互联网企业来说估计会有点压力。不过在规划的时候可以考虑主次业务分离把业务核心存储到MSSQL而读支撑由nosql的服务产品来支撑,毕竟azure还提供了其他存储服务选择。不过从价格上来看P3的费用还是比较高的,在国内大概是3W多一个月,这个价格其实可以在azure搭建linux+mariadb从性能上来说会得到一个更理想的效能。(接下来将会测试一下azure linux+mariadb的处理能力)

 

转载地址:http://qymjl.baihongyu.com/

你可能感兴趣的文章
red gate | sql CI
查看>>
blend
查看>>
[UOJ409]Highway Tolls
查看>>
[CF414E]Mashmokh's Designed Problem
查看>>
OpenSSL中关于RSA_new和RSA_free的内存泄漏
查看>>
c#中获取服务器IP,客户端IP以及Request.ServerVariables详细说明
查看>>
Centos6.5快速配置可用网卡
查看>>
mvc框架模式
查看>>
vc 串口精灵软件分析
查看>>
C#结构体和字节数组的转换
查看>>
使用Node.js搭建静态资源服务器
查看>>
bluetooth service uuid
查看>>
Android组件安全
查看>>
DOM节点属性
查看>>
Eclipse对printf()不能输出到控制台的解决方法
查看>>
【转】Open Live Writer 插件更新
查看>>
Spring Security验证流程剖析及自定义验证方法
查看>>
单链表的创建,查找,删除,插入。
查看>>
Java知识积累——Properties类的使用示例
查看>>
转:分布式ID生成方法
查看>>