added correct commands and removed duplicate stress functions
This commit is contained in:
@@ -29,9 +29,6 @@ to understand how the operating system balances efficiency and isolation.
|
||||
- [x] Thread Recursive Scaling:
|
||||
Similar recursive creation using threads to compare scalability and resource usage against
|
||||
fork().
|
||||
- [x] Maximum Limit Stress Test:
|
||||
Continuously creates processes or threads until the system refuses further creation,
|
||||
revealing OS-enforced limits on concurrency.
|
||||
- [ ] Memory and Stability Observation(removed max forks with ulimit -u 20000):
|
||||
Monitors system memory usage and system responsiveness during heavy process and
|
||||
thread creation.
|
||||
@@ -59,23 +56,34 @@ Citations will include:
|
||||
ulimit -u unlimited
|
||||
|
||||
# Raise kernel PID/thread caps (temporary until reboot)
|
||||
sudo sysctl -w kernel.pid_max=131072
|
||||
sudo sysctl -w kernel.threads-max=131072
|
||||
sysctl -w kernel.pid_max=131072
|
||||
sysctl -w kernel.threads-max=131072
|
||||
|
||||
# Lift cgroup v2 pids limit (temporary until reboot)
|
||||
sudo sh -c 'echo max > /sys/fs/cgroup/pids.max'
|
||||
|
||||
# cgroup v2 setup (Alpine Linux)
|
||||
mkdir -p /sys/fs/cgroup/test
|
||||
echo max > /sys/fs/cgroup/test/pids.max
|
||||
echo $$ > /sys/fs/cgroup/test/cgroup.procs
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Clean-up commands run after tests:
|
||||
```
|
||||
# Cleanup to make it non-persistent (move out, then delete)
|
||||
echo $$ > /sys/fs/cgroup/cgroup.procs
|
||||
rmdir /sys/fs/cgroup/test
|
||||
```
|
||||
|
||||
## Crash/Stress Behavior (Runner Env Vars)
|
||||
|
||||
The runner script uses the following environment variables to control risky experiments:
|
||||
|
||||
- `ALLOW_DANGEROUS=1` to enable `fork_bomb` and `max_limit_stress` (default: 0).
|
||||
- `ALLOW_DANGEROUS=1` to enable `fork_bomb` (default: 0).
|
||||
- `FORK_BOMB_SECONDS=<seconds>` to timebox `fork_bomb` runtime.
|
||||
- `MAX_LIMIT_SECONDS=<seconds>` to timebox `max_limit_stress` runtime.
|
||||
|
||||
Example:
|
||||
|
||||
```sh
|
||||
ALLOW_DANGEROUS=1 FORK_BOMB_SECONDS=5 MAX_LIMIT_SECONDS=5 bash run_all_experiments.sh
|
||||
ALLOW_DANGEROUS=1 FORK_BOMB_SECONDS=5 bash run_all_experiments.sh
|
||||
```
|
||||
Reference in New Issue
Block a user