Skip to content

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 ​

ProgramMemory UsageMemory Percentage (lowest value of the original = 100%)
soga(v2.5.3), default configuration193MB46%
soga(v2.5.3), with v2ray_reduce_memory=true118MB28%
v2ray(v4.41.1)424MB100%

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)

  1. The client opens multiple connections to the server through the proxy. On each connection, the client sends a random 4KB~16KB packet to the server every second, and the server sends a random 4KB~16KB packet to the client every second
  2. Each connection stays open for a random 30~120 seconds and then closes; a new connection is opened immediately after each one closes, keeping the total number of active connections constant
  3. After running for 10 minutes, memory usage levels off; memory usage is measured at that point
ProgramMemory Usage (1000 connections)Memory Percentage (lowest value of the original = 100%)
soga(v2.5.3), default 16KB connection buffer179MB55%
v2ray(v4.41.1), default configuration1203MB368%
v2ray(v4.41.1), 16KB connection buffer380MB116%
v2ray(v4.41.1), connection buffer disabled327MB100%
xray(v1.4.2), 16KB connection buffer416MB127%
xray(v1.4.2), connection buffer disabled391MB120%