Memory Usage Test
Test 1
What Was Tested
soga's memory-optimized data structures for VMess MD5 authentication info
Test Description
VMess MD5+VMessAEAD authentication, multiple users, all with alterId 0
Test Environment
Ubuntu 20.04, 4 cores, 8 GB RAM, no swap
Test Method
Add 10000 users, leave the program idle for 10 minutes after startup, then measure memory usage
Test Data
| Program | Memory Usage | Memory Percentage (lowest value of the original = 100%) |
|---|---|---|
| soga(v2.5.3), default configuration | 193MB | 46% |
soga(v2.5.3), with v2ray_reduce_memory=true | 118MB | 28% |
| v2ray(v4.41.1) | 424MB | 100% |
Test 2
What Was Tested
Simulates real-world user traffic to test soga's memory optimization under a large number of connections
Test Description
VMess+MD5+VMessAEAD authentication, websocket transport, 1 user, alterId 0
Test Environment
Ubuntu 20.04, 4 cores, 8 GB RAM, no swap
Test Method
Client->Proxy program->Server (simulated website)
- The client opens multiple connections to the server through the proxy. On each connection, the client sends a random
4KB~16KBpacket to the server every second, and the server sends a random4KB~16KBpacket to the client every second - Each connection stays open for a random
30~120seconds and then closes; a new connection is opened immediately after each one closes, keeping the total number of active connections constant - After running for 10 minutes, memory usage levels off; memory usage is measured at that point
| Program | Memory Usage (1000 connections) | Memory Percentage (lowest value of the original = 100%) |
|---|---|---|
soga(v2.5.3), default 16KB connection buffer | 179MB | 55% |
| v2ray(v4.41.1), default configuration | 1203MB | 368% |
v2ray(v4.41.1), 16KB connection buffer | 380MB | 116% |
| v2ray(v4.41.1), connection buffer disabled | 327MB | 100% |
xray(v1.4.2), 16KB connection buffer | 416MB | 127% |
| xray(v1.4.2), connection buffer disabled | 391MB | 120% |