mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 06:17:36 +00:00
feat(sentinel): deduplicate metrics push processing
Move Sentinel push handling into a controller and dispatch server update jobs only when container state changes or the force interval elapses. Add opt-in PostgreSQL read/write replica configuration and tune periodic proxy network and storage checks to reduce unnecessary work. Add feature coverage for replica config, Sentinel push deduplication, deployment log scrolling, and server update job optimizations.
This commit is contained in:
1 parent
5e0e6772d5
commit
36526928df
10 files changed
+577
-105
No files matched your search
+41
-17
@@ -1,6 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Pdo\Pgsql;
|
||||
|
||||
$pgsql = [
|
||||
'driver' => 'pgsql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => env('DB_HOST', 'coolify-db'),
|
||||
'port' => env('DB_PORT', '5432'),
|
||||
'database' => env('DB_DATABASE', 'coolify'),
|
||||
'username' => env('DB_USERNAME', 'coolify'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'search_path' => 'public',
|
||||
'sslmode' => 'prefer',
|
||||
'options' => [
|
||||
(defined('Pdo\Pgsql::ATTR_DISABLE_PREPARES') ? Pgsql::ATTR_DISABLE_PREPARES : PDO::PGSQL_ATTR_DISABLE_PREPARES) => env('DB_DISABLE_PREPARES', false),
|
||||
],
|
||||
];
|
||||
|
||||
/*
|
||||
* Opt-in read/write replica split. Activates only when DB_READ_HOST is set.
|
||||
* When unset, the pgsql connection is identical to a single-primary setup.
|
||||
* Hosts may be comma-separated; Laravel random-picks one per connection.
|
||||
*/
|
||||
if (env('DB_READ_HOST')) {
|
||||
$pgsql['read'] = [
|
||||
'host' => array_map('trim', explode(',', (string) env('DB_READ_HOST'))),
|
||||
'port' => env('DB_READ_PORT', env('DB_PORT', '5432')),
|
||||
'username' => env('DB_READ_USERNAME', env('DB_USERNAME', 'coolify')),
|
||||
'password' => env('DB_READ_PASSWORD', env('DB_PASSWORD', '')),
|
||||
];
|
||||
$pgsql['write'] = [
|
||||
'host' => array_map('trim', explode(',', (string) env('DB_WRITE_HOST', env('DB_HOST', 'coolify-db')))),
|
||||
'port' => env('DB_WRITE_PORT', env('DB_PORT', '5432')),
|
||||
'username' => env('DB_WRITE_USERNAME', env('DB_USERNAME', 'coolify')),
|
||||
'password' => env('DB_WRITE_PASSWORD', env('DB_PASSWORD', '')),
|
||||
];
|
||||
$pgsql['sticky'] = (bool) env('DB_STICKY', true);
|
||||
}
|
||||
|
||||
return [
|
||||
|
||||
@@ -35,23 +75,7 @@ return [
|
||||
|
||||
'connections' => [
|
||||
|
||||
'pgsql' => [
|
||||
'driver' => 'pgsql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => env('DB_HOST', 'coolify-db'),
|
||||
'port' => env('DB_PORT', '5432'),
|
||||
'database' => env('DB_DATABASE', 'coolify'),
|
||||
'username' => env('DB_USERNAME', 'coolify'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'search_path' => 'public',
|
||||
'sslmode' => 'prefer',
|
||||
'options' => [
|
||||
(defined('Pdo\Pgsql::ATTR_DISABLE_PREPARES') ? \Pdo\Pgsql::ATTR_DISABLE_PREPARES : \PDO::PGSQL_ATTR_DISABLE_PREPARES) => env('DB_DISABLE_PREPARES', false),
|
||||
],
|
||||
],
|
||||
'pgsql' => $pgsql,
|
||||
|
||||
'testing' => [
|
||||
'driver' => 'sqlite',
|
||||
|
||||
Reference in new issue
Block a user