mirror of
https://github.com/sadoyan/aralez.git
synced 2026-04-29 22:38:36 +08:00
pingora 0.8.0 upgrade
This commit is contained in:
13
.cargo/config.toml
Normal file
13
.cargo/config.toml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
[target.aarch64-unknown-linux-musl]
|
||||||
|
rustflags = [
|
||||||
|
"-C", "link-arg=-Wl,--defsym=fopen64=fopen",
|
||||||
|
"-C", "link-arg=-Wl,--defsym=fseeko64=fseeko",
|
||||||
|
"-C", "link-arg=-Wl,--defsym=ftello64=ftello"
|
||||||
|
]
|
||||||
|
|
||||||
|
[target.x86_64-unknown-linux-musl]
|
||||||
|
rustflags = [
|
||||||
|
"-C", "link-arg=-Wl,--defsym=fopen64=fopen",
|
||||||
|
"-C", "link-arg=-Wl,--defsym=fseeko64=fseeko",
|
||||||
|
"-C", "link-arg=-Wl,--defsym=ftello64=ftello"
|
||||||
|
]
|
||||||
754
Cargo.lock
generated
754
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
26
Cargo.toml
26
Cargo.toml
@@ -12,13 +12,13 @@ strip = true
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tokio = { version = "1.49.0", features = ["full"] }
|
tokio = { version = "1.49.0", features = ["full"] }
|
||||||
pingora = { version = "0.7.0", features = ["lb", "boringssl"] } # openssl, rustls, boringssl
|
pingora = { version = "0.8.0", features = ["lb", "openssl"] } # openssl, rustls, boringssl
|
||||||
serde = { version = "1.0.228", features = ["derive"] }
|
serde = { version = "1.0.228", features = ["derive"] }
|
||||||
dashmap = "7.0.0-rc2"
|
dashmap = "7.0.0-rc2"
|
||||||
pingora-core = "0.7.0"
|
pingora-core = "0.8.0"
|
||||||
pingora-proxy = "0.7.0"
|
pingora-proxy = "0.8.0"
|
||||||
pingora-http = "0.7.0"
|
pingora-http = "0.8.0"
|
||||||
pingora-limits = "0.7.0"
|
pingora-limits = "0.8.0"
|
||||||
async-trait = "0.1.89"
|
async-trait = "0.1.89"
|
||||||
env_logger = "0.11.9"
|
env_logger = "0.11.9"
|
||||||
log = "0.4.29"
|
log = "0.4.29"
|
||||||
@@ -26,25 +26,27 @@ futures = "0.3.32"
|
|||||||
notify = "9.0.0-rc.2"
|
notify = "9.0.0-rc.2"
|
||||||
axum = { version = "0.8.8" }
|
axum = { version = "0.8.8" }
|
||||||
#axum-server = { version = "0.8.0" }
|
#axum-server = { version = "0.8.0" }
|
||||||
reqwest = { version = "0.13.1", features = ["json", "stream"] }
|
reqwest = { version = "0.13.2", features = ["json", "stream"] }
|
||||||
serde_yaml = "0.9.34-deprecated"
|
serde_yaml = "0.9.34-deprecated"
|
||||||
rand = "0.10.0-rc.8"
|
rand = "0.10.0"
|
||||||
base64 = "0.22.1"
|
base64 = "0.22.1"
|
||||||
jsonwebtoken = { version = "10.3.0", features = ["aws_lc_rs"] }
|
#jsonwebtoken = { version = "10.3.0", features = ["aws_lc_rs"] }
|
||||||
tonic = "0.14.3"
|
#jsonwebtoken = { version = "10.3.0", default-features = false, features = ["use_pem"] }
|
||||||
|
jsonwebtoken = { version = "10.3.0", default-features = false, features = ["use_pem", "rust_crypto"] }
|
||||||
|
tonic = "0.14.5"
|
||||||
sha2 = { version = "0.11.0-rc.5", default-features = false }
|
sha2 = { version = "0.11.0-rc.5", default-features = false }
|
||||||
base16ct = { version = "1.0.0", features = ["alloc"] }
|
base16ct = { version = "1.0.0", features = ["alloc"] }
|
||||||
urlencoding = "2.1.3"
|
urlencoding = "2.1.3"
|
||||||
arc-swap = "1.8.1"
|
arc-swap = "1.8.2"
|
||||||
mimalloc = { version = "0.1.48", default-features = false }
|
mimalloc = { version = "0.1.48", default-features = false }
|
||||||
prometheus = "0.14.0"
|
prometheus = "0.14.0"
|
||||||
lazy_static = "1.5.0"
|
lazy_static = "1.5.0"
|
||||||
x509-parser = "0.18.0"
|
x509-parser = "0.18.1"
|
||||||
rustls-pemfile = "2.2.0"
|
rustls-pemfile = "2.2.0"
|
||||||
tower-http = { version = "0.6.8", features = ["fs"] }
|
tower-http = { version = "0.6.8", features = ["fs"] }
|
||||||
once_cell = "1.21.3"
|
once_cell = "1.21.3"
|
||||||
privdrop = "0.5.6"
|
privdrop = "0.5.6"
|
||||||
ctrlc = "3.5.1"
|
ctrlc = "3.5.2"
|
||||||
port_check = "0.3.0"
|
port_check = "0.3.0"
|
||||||
serde_json = "1.0.149"
|
serde_json = "1.0.149"
|
||||||
http = "1.4.0"
|
http = "1.4.0"
|
||||||
|
|||||||
@@ -13,14 +13,17 @@ use pingora::prelude::*;
|
|||||||
use pingora::ErrorSource::Upstream;
|
use pingora::ErrorSource::Upstream;
|
||||||
use pingora_core::listeners::ALPN;
|
use pingora_core::listeners::ALPN;
|
||||||
use pingora_core::prelude::HttpPeer;
|
use pingora_core::prelude::HttpPeer;
|
||||||
|
// use pingora_core::protocols::TcpKeepalive;
|
||||||
use pingora_limits::rate::Rate;
|
use pingora_limits::rate::Rate;
|
||||||
use pingora_proxy::{ProxyHttp, Session};
|
use pingora_proxy::{ProxyHttp, Session};
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
// use std::collections::BTreeMap;
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use tokio::time::Instant;
|
use tokio::time::Instant;
|
||||||
|
// use x509_parser::asn1_rs::ToDer;
|
||||||
|
|
||||||
static RATE_LIMITER: Lazy<Rate> = Lazy::new(|| Rate::new(Duration::from_secs(1)));
|
static RATE_LIMITER: Lazy<Rate> = Lazy::new(|| Rate::new(Duration::from_secs(1)));
|
||||||
static REVERSE_STORE: Lazy<DashMap<String, String>> = Lazy::new(|| DashMap::new());
|
static REVERSE_STORE: Lazy<DashMap<String, String>> = Lazy::new(|| DashMap::new());
|
||||||
@@ -136,6 +139,19 @@ impl ProxyHttp for LB {
|
|||||||
peer.options.verify_hostname = false;
|
peer.options.verify_hostname = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Experimental optionsv
|
||||||
|
// The following TCP optimizations were tested but caused performance degrade under heavy load:
|
||||||
|
// peer.options.tcp_keepalive = Some(TcpKeepalive {
|
||||||
|
// idle: Duration::from_secs(60),
|
||||||
|
// interval: Duration::from_secs(10),
|
||||||
|
// count: 5,
|
||||||
|
// user_timeout: Duration::from_secs(30),
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// peer.options.idle_timeout = Some(Duration::from_secs(300));
|
||||||
|
// peer.options.tcp_recv_buf = Some(128 * 1024);
|
||||||
|
// End of experimental options
|
||||||
|
|
||||||
if ctx.extraparams.to_https.unwrap_or(false) || innermap.to_https {
|
if ctx.extraparams.to_https.unwrap_or(false) || innermap.to_https {
|
||||||
if let Some(stream) = session.stream() {
|
if let Some(stream) = session.stream() {
|
||||||
if stream.get_ssl().is_none() {
|
if stream.get_ssl().is_none() {
|
||||||
@@ -250,7 +266,8 @@ impl ProxyHttp for LB {
|
|||||||
}
|
}
|
||||||
// END ALLOCATIONS !
|
// END ALLOCATIONS !
|
||||||
|
|
||||||
session.set_keepalive(Some(300));
|
// session.set_keepalive(Some(300));
|
||||||
|
// println!("session.get_keepalive: {:?}", session.get_keepalive());
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user