diff --git a/rust/migration/src/lib.rs b/rust/migration/src/lib.rs index 6f9e53224..8ad0160bb 100644 --- a/rust/migration/src/lib.rs +++ b/rust/migration/src/lib.rs @@ -13,6 +13,7 @@ mod m20240522_185420_create_job_history; mod m20240731_152842_create_job_size_proc; mod m20240731_201632_create_job_blob_timestamp_index; mod m20240805_163520_create_blob_id_fk_indexes; +mod m20240819_193352_add_output_indexes; pub struct Migrator; @@ -33,6 +34,7 @@ impl MigratorTrait for Migrator { Box::new(m20240731_152842_create_job_size_proc::Migration), Box::new(m20240731_201632_create_job_blob_timestamp_index::Migration), Box::new(m20240805_163520_create_blob_id_fk_indexes::Migration), + Box::new(m20240819_193352_add_output_indexes::Migration), ] } } diff --git a/rust/migration/src/m20240819_193352_add_output_indexes.rs b/rust/migration/src/m20240819_193352_add_output_indexes.rs new file mode 100644 index 000000000..bc413ad87 --- /dev/null +++ b/rust/migration/src/m20240819_193352_add_output_indexes.rs @@ -0,0 +1,72 @@ +use sea_orm_migration::prelude::*; + +#[derive(DeriveMigrationName)] +pub struct Migration; + +#[async_trait::async_trait] +impl MigrationTrait for Migration { + async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { + manager + .get_connection() + .execute_unprepared( + " + CREATE INDEX IF NOT EXISTS output_file_job_id_idx + ON output_file(job_id) + ", + ) + .await?; + + manager + .get_connection() + .execute_unprepared( + " + CREATE INDEX IF NOT EXISTS output_dir_job_id_idx + ON output_dir(job_id) + ", + ) + .await?; + + manager + .get_connection() + .execute_unprepared( + " + CREATE INDEX IF NOT EXISTS output_symlink_job_id_idx + ON output_symlink(job_id) + ", + ) + .await?; + + Ok(()) + } + + async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { + manager + .get_connection() + .execute_unprepared( + " + DROP INDEX IF EXISTS output_file_job_id_idx + ", + ) + .await?; + + manager + .get_connection() + .execute_unprepared( + " + DROP INDEX IF EXISTS output_dir_job_id_idx + ", + ) + .await?; + + manager + .get_connection() + .execute_unprepared( + " + DROP INDEX IF EXISTS output_symlink_job_id_idx + ", + ) + .await?; + + Ok(()) + } +} diff --git a/rust/rsc/.config.json b/rust/rsc/.config.json index 5157da9ab..e6b1b9cc6 100644 --- a/rust/rsc/.config.json +++ b/rust/rsc/.config.json @@ -3,7 +3,7 @@ "server_address": "0.0.0.0:3002", "connection_pool_timeout": 60, "standalone": false, - "active_store": "ad834497-92f8-438e-91b7-9b54108d8ea5", + "active_store": "5eed6ba4-d65f-46ca-b4a6-eff98b00857d", "log_directory": null, "blob_eviction": { "tick_rate": 60, @@ -23,7 +23,7 @@ }, "load_shed": { "tick_rate": 30, - "target": 16.0, - "min_runtime": 0.1 + "target": 80.0, + "min_runtime": 0.5 } }