20260416_2 并行优化phase1后进行snapshot fast path优化,通过四方面关键优化技术消除了验证主链路上snapshot构建是的db访问性能热点问题,性能热点转移到ROA验证处理本身,目前APNIC+ARIN全量同步从500秒压缩到212秒,离rpkclient 112秒差距变小
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn usage() -> &'static str {
|
||||
"Usage: cir_materialize --cir <path> (--static-root <path> | --raw-store-db <path>) --mirror-root <path> [--keep-db]"
|
||||
"Usage: cir_materialize --cir <path> (--repo-bytes-db <path> | --raw-store-db <path> | --static-root <path>) --mirror-root <path> [--keep-db]"
|
||||
}
|
||||
|
||||
fn main() {
|
||||
@@ -14,6 +14,7 @@ fn main() {
|
||||
fn run(argv: Vec<String>) -> Result<(), String> {
|
||||
let mut cir_path: Option<PathBuf> = None;
|
||||
let mut static_root: Option<PathBuf> = None;
|
||||
let mut repo_bytes_db: Option<PathBuf> = None;
|
||||
let mut raw_store_db: Option<PathBuf> = None;
|
||||
let mut mirror_root: Option<PathBuf> = None;
|
||||
let mut keep_db = false;
|
||||
@@ -32,6 +33,12 @@ fn run(argv: Vec<String>) -> Result<(), String> {
|
||||
argv.get(i).ok_or("--static-root requires a value")?,
|
||||
));
|
||||
}
|
||||
"--repo-bytes-db" => {
|
||||
i += 1;
|
||||
repo_bytes_db = Some(PathBuf::from(
|
||||
argv.get(i).ok_or("--repo-bytes-db requires a value")?,
|
||||
));
|
||||
}
|
||||
"--raw-store-db" => {
|
||||
i += 1;
|
||||
raw_store_db = Some(PathBuf::from(
|
||||
@@ -53,10 +60,11 @@ fn run(argv: Vec<String>) -> Result<(), String> {
|
||||
let cir_path = cir_path.ok_or_else(|| format!("--cir is required\n\n{}", usage()))?;
|
||||
let mirror_root =
|
||||
mirror_root.ok_or_else(|| format!("--mirror-root is required\n\n{}", usage()))?;
|
||||
let backend_count = static_root.is_some() as u8 + raw_store_db.is_some() as u8;
|
||||
let backend_count =
|
||||
static_root.is_some() as u8 + raw_store_db.is_some() as u8 + repo_bytes_db.is_some() as u8;
|
||||
if backend_count != 1 {
|
||||
return Err(format!(
|
||||
"must specify exactly one of --static-root or --raw-store-db\n\n{}",
|
||||
"must specify exactly one of --repo-bytes-db, --raw-store-db or --static-root\n\n{}",
|
||||
usage()
|
||||
));
|
||||
}
|
||||
@@ -68,6 +76,9 @@ fn run(argv: Vec<String>) -> Result<(), String> {
|
||||
let result = if let Some(static_root) = static_root {
|
||||
rpki::cir::materialize_cir(&cir, &static_root, &mirror_root, true)
|
||||
.map_err(|e| e.to_string())
|
||||
} else if let Some(repo_bytes_db) = repo_bytes_db {
|
||||
rpki::cir::materialize_cir_from_repo_bytes(&cir, &repo_bytes_db, &mirror_root, true)
|
||||
.map_err(|e| e.to_string())
|
||||
} else if let Some(raw_store_db) = raw_store_db {
|
||||
rpki::cir::materialize_cir_from_raw_store(&cir, &raw_store_db, &mirror_root, true)
|
||||
.map_err(|e| e.to_string())
|
||||
|
||||
Reference in New Issue
Block a user