sebj54/lb-healthcheck-php
Composer 安装命令:
composer require sebj54/lb-healthcheck-php
包简介
Helper classes for quickly implementing LB health check pages
README 文档
README
Load balancer health check library and examples for PHP. Optimized for use with HOSTING Cloud Load Balancer but should work with just about any deployment.
Installation
We recommend you install the LB Health Check functions with the Composer dependency manager. Run this bash command in your project's root directory to download and install the latest stable version into your project's vendor/ directory.
composer require sebj54/lb-healthcheck-php
Next, require the Composer autoloader into your PHP application:
<?php require 'vendor/autoload.php';
And you're ready to go.
Usage
This library is intended to be used most often with custom health check logic that you write and tests the critical components of your application. Examples of things to test would be:
- Connectivity to your database or other storage repository
- Availabilty of critical services (e.g., payment gateway, service bus)
- Functionality of core business logic (e.g., call some controller functions)
You can find examples of how to implement a health check script using your own custom logic in the examples/php folder.
If you're just wanting to get started quickly or if you're only concerned about the web server responding to requests and executing PHP scripts, perhaps the bare minimum implementation is for you:
<?php require 'vendor/autoload.php'; \HOSTING\LBHealthCheck::success();
Drop that in your webroot as health.php and if PHP is working, that single call to \HOSTING\LBHealthCheck::success() will complete and return the necessary HTTP status code and string to inform the load balancer to keep the server as an active member of the cluster. If the webserver or PHP processing is broken, it will return an error or timeout which will cause the load balacner to eject the server from the load balancing group.
Load Balancer Configuration
Here is what that Cloud Load Balancer configuration would look like in the HOSTING Customer Portal.
sebj54/lb-healthcheck-php 适用场景与选型建议
sebj54/lb-healthcheck-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 01 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 sebj54/lb-healthcheck-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sebj54/lb-healthcheck-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-01-29