Files
drip/internal/shared/tuning/mem_linux.go
Gouryella 88e4525bf6 perf(core): Optimizes performance configuration and resource management
- Removed the manual performance optimization configuration in main.go and replaced it with a new tuning module.
- Add patterned GC tuning in server.go and tunnel_runner.go
- Updated yamux configuration to a unified optimized configuration to improve throughput.
- Implement connection pool preheating function to eliminate cold start delay.
- Optimize session selection using a min-heap, reducing the time complexity from O(n) to O(log n).
- Add a bufio.Reader pool and a buffer pool to reduce memory allocation.
- Implement a fragmented lock manager to improve performance under high concurrency.
- Adjust heartbeat and timeout configurations to suit high-throughput scenarios
BREAKING CHANGE: Manual GC tuning configuration has been removed; automatic tuning mode is now used.
2025-12-23 11:16:12 +08:00

14 lines
240 B
Go

//go:build linux
package tuning
import "syscall"
func getSystemTotalMemory() uint64 {
var info syscall.Sysinfo_t
if err := syscall.Sysinfo(&info); err == nil {
return info.Totalram * uint64(info.Unit)
}
return 1024 * 1024 * 1024
}