Revert "Increase in-process max open files limit"
This reverts commit 7bf545f5e5.
This commit is contained in:
13
main.go
13
main.go
@@ -8,7 +8,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"syscall"
|
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -33,10 +32,6 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := increaseResourceLimits(); err != nil {
|
|
||||||
log.Fatalf("Couldn't increase resource limits: %s", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate rate argument
|
// Validate rate argument
|
||||||
if *rate == 0 {
|
if *rate == 0 {
|
||||||
log.Fatal("rate can't be zero")
|
log.Fatal("rate can't be zero")
|
||||||
@@ -107,11 +102,3 @@ func attack(targets Targets, ordering string, rate uint, duration time.Duration,
|
|||||||
rep.Add(<-responses)
|
rep.Add(<-responses)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func increaseResourceLimits() error {
|
|
||||||
limit := &syscall.Rlimit{Cur: syscall.RLIM_INFINITY}
|
|
||||||
if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, limit); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user