diff --git a/.github/workflows/samply.yml b/.github/workflows/samply.yml new file mode 100644 index 00000000..2ac77ae7 --- /dev/null +++ b/.github/workflows/samply.yml @@ -0,0 +1,37 @@ +name: Profile with Samply +on: + push: + branches: [ main ] +jobs: + profile: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: llvm-tools-preview + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - run: cargo install samply + - run: echo '1' | sudo tee /proc/sys/kernel/perf_event_paranoid + - name: Create test volumes + run: | + for i in {0..4}; do + mkdir -p ./target/volume/test$i + done + - name: Set RUSTFS_VOLUMES + run: | + export RUSTFS_VOLUMES="./target/volume/test{0...4}" + echo "RUSTFS_VOLUMES=$RUSTFS_VOLUMES" >> $GITHUB_ENV + - run: echo "RUSTFS_VOLUMES is $RUSTFS_VOLUMES" # Debug output + - run: RUSTFLAGS="-C force-frame-pointers=yes" cargo +nightly build --profile profiling -p rustfs --bins + - run: samply record --output profile.json ./target/profiling/rustfs ${RUSTFS_VOLUMES} + - uses: actions/upload-artifact@v4 + with: + name: samply-profile + path: profile.json \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0a1501ce..46bfa8d4 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,6 @@ deploy/config/obs.toml deploy/certs/* *jsonl .env -.rustfs.sys \ No newline at end of file +.rustfs.sys +.cargo +profile.json \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 852c7302..31b95436 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -218,3 +218,7 @@ strip = true # strip symbol information to reduce binary size inherits = "release" lto = "fat" codegen-units = 1 + +[profile.profiling] +inherits = "release" +debug = true \ No newline at end of file diff --git a/crates/config/src/constants/app.rs b/crates/config/src/constants/app.rs index 45a0997c..c4f22f93 100644 --- a/crates/config/src/constants/app.rs +++ b/crates/config/src/constants/app.rs @@ -84,7 +84,7 @@ pub const DEFAULT_ADDRESS: &str = concat!(":", DEFAULT_PORT); /// Default port for rustfs console /// This is the default port for rustfs console. -pub const DEFAULT_CONSOLE_PORT: u16 = 9002; +pub const DEFAULT_CONSOLE_PORT: u16 = 9001; /// Default address for rustfs console /// This is the default address for rustfs console.