---
title: "Mogile-REST-Service与nginxmogilemodule对比测试"
author: "qiaoshi"
date: "2015-01-23T15:18:47Z"
tags: []
categories: ["行业应用"]
slug: "mogile-rest-service-nginxmogilemodule"
draft: false
lastmod: "2015-01-23T15:23:08Z"
id: 2178950
url: "https://qiaoshi.iteye.com/blog/2178950"
---

### Mogilefs-REST- Service 测试

#### 测试目的

- 测试使用MogileFS-REST-Service的稳定性和可用性
- 对比nginx*mogilefs*module与MogileFS-REST的上传，下载，删除方法性能

#### 测试方法

- 重复上传下载删除不同大小的文件，测试MogileFS-REST服务可用性和稳定性
- 重复上传下载删除不同大小的文件到nginx*mogilefs*module，MogileFS-REST，记录耗时数据进行对比

#### 测试环境

- 环境描述：   
  MogileFS-REST app server：**.**.\*\*.252/10.20.169.194   
  tracker：**.**.\*\*.252/10.20.169.194   
  node1：**.**.\*\*.252/10.20.169.194   
  node2：**.**.\*\*.173/10.20.169.18   
  文件上传，下载，删除操作均在局域网
- 硬件配置：C2
- 软件配置：mogilefs 2.72,MogileFS-REST ,Mysql 5.5.31

#### 环境配置

- 安装数据库：   
  create database mogilefs;   
  grant all privileges on mogilefs.* to ‘mogile’@’localhost’ identified by ‘123’;   
  grant all privileges on mogilefs.* to ‘mogile’@’10.20.169.18’ identified by ‘123’;   
  flush privileges;
- 配置mogilefs   
  略
- 服务健康检查   
  mogadm –trackers=10.20.169.194:7001 check
- 测试 mogilefsd 服务：   
  mogupload –domain=testing –key=123 –file=README –trackers=10.20.169.194   
  mogfileinfo –domain=testing –key=123 –trackers=10.20.169.194
- 安装MogileFS-REST-Service   
  git clone git@github.com/yannk/MogileFS-REST.git
- 启动MogileFS-REST-Service：   
  cd /home/liuyd/MogileFS-REST-Service   
  MOGILEFS*REST*DEFAULT*CLASS=test2 MOGILEFS*REST\_SERVERS=localhost:7001 plackup -Ilib -a app.psgi &
- 测试MogileFS-REST-Service服务：   
  curl -i -X GET [http://10.20.169.194:5000/testing/123](http://10.20.169.194:5000/testing/123)

#### 对比测试

![](http://dl2.iteye.com/upload/attachment/0105/5357/1bb160e8-09f5-386b-912c-d00d67248d96.jpg)  
 

#### 结论

- Mogile-REST-Service 服务可用
- Mogile-REST-Service性能比 nginx*mogile*module差很多，特别是在下载和删除操作上
- Mogile-REST-Service下载性能太差，不适于应用于生产环境
- 测试未发现Mogile-REST-Service服务上传，下载，删除失败的情况
- 测试未发现 Nginx*mogile*module 服务上传，下载，删除失败的情况