Reduce number of concurrent Redis connections by consolidating to one DB.

This commit is contained in:
Buster Neece 2019-08-17 20:33:44 -05:00
parent 485e7b3470
commit d4b2b22428
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
4 changed files with 54 additions and 52 deletions

82
composer.lock generated
View File

@ -8,16 +8,16 @@
"packages": [
{
"name": "aws/aws-sdk-php",
"version": "3.109.1",
"version": "3.109.6",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "1fb0ddf20c9b1a82dcc4dbae2362bb6de1392d31"
"reference": "c129c2120943340cb102ab1a1c7c76d03c00bcc4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/1fb0ddf20c9b1a82dcc4dbae2362bb6de1392d31",
"reference": "1fb0ddf20c9b1a82dcc4dbae2362bb6de1392d31",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/c129c2120943340cb102ab1a1c7c76d03c00bcc4",
"reference": "c129c2120943340cb102ab1a1c7c76d03c00bcc4",
"shasum": ""
},
"require": {
@ -87,7 +87,7 @@
"s3",
"sdk"
],
"time": "2019-08-09T18:17:08+00:00"
"time": "2019-08-16T18:13:56+00:00"
},
{
"name": "azuracast/azuracore",
@ -95,12 +95,12 @@
"source": {
"type": "git",
"url": "https://github.com/AzuraCast/azuracore.git",
"reference": "adc68269f3998a7a0202464703e130a9432073fc"
"reference": "9041b9c0d157d216cd4157af1adfc90f71b08e9b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/AzuraCast/azuracore/zipball/adc68269f3998a7a0202464703e130a9432073fc",
"reference": "adc68269f3998a7a0202464703e130a9432073fc",
"url": "https://api.github.com/repos/AzuraCast/azuracore/zipball/9041b9c0d157d216cd4157af1adfc90f71b08e9b",
"reference": "9041b9c0d157d216cd4157af1adfc90f71b08e9b",
"shasum": ""
},
"require": {
@ -152,7 +152,7 @@
}
],
"description": "A lightweight core application framework.",
"time": "2019-08-10T17:03:32+00:00"
"time": "2019-08-18T00:01:00+00:00"
},
{
"name": "azuracast/azuraforms",
@ -3212,16 +3212,16 @@
},
{
"name": "nikic/php-parser",
"version": "v4.2.2",
"version": "v4.2.3",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "1bd73cc04c3843ad8d6b0bfc0956026a151fc420"
"reference": "e612609022e935f3d0337c1295176505b41188c8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bd73cc04c3843ad8d6b0bfc0956026a151fc420",
"reference": "1bd73cc04c3843ad8d6b0bfc0956026a151fc420",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/e612609022e935f3d0337c1295176505b41188c8",
"reference": "e612609022e935f3d0337c1295176505b41188c8",
"shasum": ""
},
"require": {
@ -3229,7 +3229,7 @@
"php": ">=7.0"
},
"require-dev": {
"phpunit/phpunit": "^6.5 || ^7.0"
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0"
},
"bin": [
"bin/php-parse"
@ -3259,7 +3259,7 @@
"parser",
"php"
],
"time": "2019-05-25T20:07:01+00:00"
"time": "2019-08-12T20:17:41+00:00"
},
{
"name": "ocramius/package-versions",
@ -4921,12 +4921,12 @@
"source": {
"type": "git",
"url": "https://github.com/slimphp/Slim.git",
"reference": "a62257ea53041539ffeb3a785f2c0269b89a6eff"
"reference": "335b5fd1c6c56023ab9ebed48ad5811d4fce5a45"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/slimphp/Slim/zipball/a62257ea53041539ffeb3a785f2c0269b89a6eff",
"reference": "a62257ea53041539ffeb3a785f2c0269b89a6eff",
"url": "https://api.github.com/repos/slimphp/Slim/zipball/335b5fd1c6c56023ab9ebed48ad5811d4fce5a45",
"reference": "335b5fd1c6c56023ab9ebed48ad5811d4fce5a45",
"shasum": ""
},
"require": {
@ -4954,6 +4954,8 @@
"zendframework/zend-diactoros": "^2.1"
},
"suggest": {
"ext-simplexml": "Needed to support XML format in BodyParsingMiddleware",
"ext-xml": "Needed to support XML format in BodyParsingMiddleware",
"slim/psr7": "Slim PSR-7 implementation. See http://www.slimframework.com/docs/v4/start/installation.html for more information."
},
"type": "library",
@ -5002,7 +5004,7 @@
"micro",
"router"
],
"time": "2019-08-10T15:27:08+00:00"
"time": "2019-08-16T20:15:11+00:00"
},
{
"name": "spomky-labs/otphp",
@ -8159,16 +8161,16 @@
},
{
"name": "phpstan/phpstan",
"version": "0.11.12",
"version": "0.11.14",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "56b3eb2a371b60537fd20794e24af9e7e8ed4e30"
"reference": "b343bbf83d0dd08db917408d8efd99b140ce04c6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/56b3eb2a371b60537fd20794e24af9e7e8ed4e30",
"reference": "56b3eb2a371b60537fd20794e24af9e7e8ed4e30",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/b343bbf83d0dd08db917408d8efd99b140ce04c6",
"reference": "b343bbf83d0dd08db917408d8efd99b140ce04c6",
"shasum": ""
},
"require": {
@ -8179,7 +8181,7 @@
"nette/robot-loader": "^3.0.1",
"nette/schema": "^1.0",
"nette/utils": "^2.4.5 || ^3.0",
"nikic/php-parser": "^4.0.2",
"nikic/php-parser": "^4.2.3",
"php": "~7.1",
"phpstan/phpdoc-parser": "^0.3.5",
"symfony/console": "~3.2 || ~4.0",
@ -8189,7 +8191,7 @@
"symfony/console": "3.4.16 || 4.1.5"
},
"require-dev": {
"brianium/paratest": "^2.0",
"brianium/paratest": "^2.0 || ^3.0",
"consistence/coding-standard": "^3.5",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
"ext-intl": "*",
@ -8204,7 +8206,7 @@
"phpstan/phpstan-php-parser": "^0.11",
"phpstan/phpstan-phpunit": "^0.11",
"phpstan/phpstan-strict-rules": "^0.11",
"phpunit/phpunit": "^7.0",
"phpunit/phpunit": "^7.5.14 || ^8.0",
"slevomat/coding-standard": "^4.7.2",
"squizlabs/php_codesniffer": "^3.3.2"
},
@ -8230,7 +8232,7 @@
"MIT"
],
"description": "PHPStan - PHP Static Analysis Tool",
"time": "2019-07-08T06:55:18+00:00"
"time": "2019-08-17T12:49:22+00:00"
},
{
"name": "phpstan/phpstan-doctrine",
@ -9118,16 +9120,16 @@
},
{
"name": "sebastian/exporter",
"version": "3.1.0",
"version": "3.1.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "234199f4528de6d12aaa58b612e98f7d36adb937"
"reference": "06a9a5947f47b3029d76118eb5c22802e5869687"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937",
"reference": "234199f4528de6d12aaa58b612e98f7d36adb937",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/06a9a5947f47b3029d76118eb5c22802e5869687",
"reference": "06a9a5947f47b3029d76118eb5c22802e5869687",
"shasum": ""
},
"require": {
@ -9154,6 +9156,10 @@
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
},
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
@ -9162,17 +9168,13 @@
"name": "Volker Dusch",
"email": "github@wallbash.com"
},
{
"name": "Bernhard Schussek",
"email": "bschussek@2bepublished.at"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
},
{
"name": "Adam Harvey",
"email": "aharvey@php.net"
},
{
"name": "Bernhard Schussek",
"email": "bschussek@gmail.com"
}
],
"description": "Provides the functionality to export PHP variables for visualization",
@ -9181,7 +9183,7 @@
"export",
"exporter"
],
"time": "2017-04-03T13:19:02+00:00"
"time": "2019-08-11T12:43:14+00:00"
},
{
"name": "sebastian/global-state",

View File

@ -136,15 +136,11 @@ return [
// Message queue manager class
App\MessageQueue::class => function(
DI\FactoryInterface $factory,
\Redis $redis,
ContainerInterface $di,
Monolog\Logger $logger
) {
// Build QueueFactory
/** @var Redis $redis */
$redis = $factory->make(Redis::class);
$redis->select(4);
$driver = new Bernard\Driver\PhpRedis\Driver($redis);
$normalizer = new Normalt\Normalizer\AggregateNormalizer([
@ -238,13 +234,7 @@ return [
App\Radio\AutoDJ::class => DI\autowire(),
App\Radio\Configuration::class => DI\autowire(),
App\Radio\Filesystem::class => function(DI\FactoryInterface $factory) {
/** @var Redis $redis */
$redis = $factory->make(Redis::class);
$redis->select(5);
return new App\Radio\Filesystem($redis);
},
App\Radio\Filesystem::class => DI\autowire(),
App\Radio\Backend\Liquidsoap::class => DI\autowire(),
App\Radio\Backend\None::class => DI\autowire(),

View File

@ -66,6 +66,10 @@ services:
- "127.0.0.1:6379:6379"
restart: always
logging: *default-logging
sysctls:
net.core.somaxconn: 1024
volumes:
- redis_data:/data
stations:
container_name: azuracast_stations
@ -126,4 +130,5 @@ volumes:
station_data: {}
shoutcast2_install: {}
tmp_data: {}
redis_data: {}
backups: {}

View File

@ -65,6 +65,10 @@ services:
image: azuracast/azuracast_redis:latest
restart: always
logging: *default-logging
sysctls:
net.core.somaxconn: 1024
volumes:
- redis_data:/data
stations:
container_name: azuracast_stations
@ -239,4 +243,5 @@ volumes:
station_data: {}
tmp_data: {}
www_data: {}
redis_data: {}
backups: {}