定制 mt-olympus/metis 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mt-olympus/metis

Composer 安装命令:

composer require mt-olympus/metis

包简介

Load Balance implementation in PHP

README 文档

README

Introduction

This is a Dynamic Routing and Load Balance library made with PHP.

It's goal is to "choose" an endpoint to connect to in distributed systems, like in a micro service architeture.

You can use this library with Athena server, that can returns more than one server and use this module to choose one of them based on some rules and statistics about the servers.

You can inject a Metis instance to a Hermes, and it will automatically choose a server to connect to. More info on the Hermes documentation.

Components

  • Service list
  • Rule

Service list

  • Static: from a configuration file
  • Fetched: from a remote server

The fetched method is available through one of the following libraries:

Static server list

The list is an well formed array:

return [
    'metis' => [
        'services' => [
            'service1' => [ // a unique service identification
                [
                    'host' => 'server1',
                    'uri' => 'http://192.168.1.2/v1/service1',
                ],
                [
                    'host' => 'server2',
                    'uri' => 'https://server2/v1/service1',
                ],
                [
                    'host' => 'server3',
                    'uri' => 'https://server3.mycompany.com:7001/v1/service1',
                ],
            ],
            'service2' => [ // a unique service identification
                [
                    'host' => 'server1',
                    'uri' => 'http://192.168.1.2:7002/v1/service2',
                ],
            ],
        ],
    ],
];

Strategy

Regardless the chosen strategy, if there is a Cerberus (Circuit Breaker) attached, the unavailable services will be filtered.

  • RoundRobin: Cycles among the services in a specific order
  • Random: Each time will select a random service from the list
  • ResponseTime: Each service has it's response time measured and this time is weighted. The faster service have more probability to be chosen.

Installation

composer require mt-olympus/metis

Zend Expressive

Just copy the config/metis.global.php.dist to your expressive project as config/autoload/metis.global.php

Zend Framework

Include the module in your application.config.php

统计信息

  • 总下载量: 24.26k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固