[PR #3887] [MERGED] perf: replace /dev/urandom | tr with openssl rand to fix CPU spike in gen_random_string #5550

Closed
opened 2026-10-31 20:47:45 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/3887
Author: @Kookiejarz
Created: 3/5/2026
Status: ✅ Merged
Merged: 4/1/2026
Merged by: @MHSanaei

Base: main ← Head: main


📝 Commits (1)

  • e1a09b5 perf: replace /dev/urandom | tr with openssl rand to fix CPU spike

📊 Changes

3 files changed (+25 additions, -22 deletions)

View changed files

📝 install.sh (+11 -10)
📝 update.sh (+11 -10)
📝 x-ui.sh (+3 -2)

📄 Description

closes #3886

Replace /dev/urandom | tr pipeline with openssl rand -base64 to reduce
tr's byte rejection rate from ~75% to ~2%, fixing CPU spikes on low-spec VPS.

See issue #3886 for detailed analysis.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/3887 **Author:** [@Kookiejarz](https://github.com/Kookiejarz) **Created:** 3/5/2026 **Status:** ✅ Merged **Merged:** 4/1/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`e1a09b5`](https://github.com/MHSanaei/3x-ui/commit/e1a09b5f682ceebf3f3bce279dde5a6faa66492c) perf: replace /dev/urandom | tr with openssl rand to fix CPU spike ### 📊 Changes **3 files changed** (+25 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `install.sh` (+11 -10) 📝 `update.sh` (+11 -10) 📝 `x-ui.sh` (+3 -2) </details> ### 📄 Description closes #3886 Replace /dev/urandom | tr pipeline with openssl rand -base64 to reduce tr's byte rejection rate from ~75% to ~2%, fixing CPU spikes on low-spec VPS. See issue #3886 for detailed analysis. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 20:47:45 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5550
No description provided.