Revert "Increase in-process max open files limit"

This reverts commit 7bf545f5e5.
This commit is contained in:
Tomás Senart
2013-08-14 22:46:56 +02:00
parent caf84d1910
commit 1a9ca5a84d

13
main.go
View File

@@ -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
}