Download the PHP package mt-olympus/metis without Composer
On this page you can find all versions of the php package mt-olympus/metis. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mt-olympus/metis
More information about mt-olympus/metis
Files in mt-olympus/metis
Package metis
Short Description Load Balance implementation in PHP
License MIT
Homepage https://github.com/mt-olympus/metis
Informations about the package metis
Metis
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:
- metis-athena: Fetches the list from a Athena (Service Discovery) service
- metis-demeter: Fetches the list from a Demeter (Distributed Configuration) service
Static server list
The list is an well formed array:
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
Zend Expressive
Just copy the to your expressive project as config/autoload/metis.global.php
Zend Framework
Include the module in your application.config.php
All versions of metis with dependencies
laminas/laminas-stdlib Version ^3.0
laminas/laminas-servicemanager Version ^3.1
laminas/laminas-cache Version ^2.8 || ^2.9
mt-olympus/hermes Version ^1.5