From de9fb4a0a60dacbb0c424701c640a971242a4ece Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Mon, 21 Nov 2016 19:48:39 +0300 Subject: [PATCH] some fixes for close socket --- generate-template-clients.sh | 2 +- src/main.go | 5 ++--- src/zabbix/sender.go | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/generate-template-clients.sh b/generate-template-clients.sh index 4a21e42..f222660 100644 --- a/generate-template-clients.sh +++ b/generate-template-clients.sh @@ -3,7 +3,7 @@ TEMPLATE_NAME="zabbix-bench" GROUP_NAME="Linux servers" CLIENT_PREFIX="client" -CLIENTS=40000 +CLIENTS=2000 echo " diff --git a/src/main.go b/src/main.go index 4930220..6d0c2b5 100644 --- a/src/main.go +++ b/src/main.go @@ -14,13 +14,12 @@ import ( ) var ( - argClientCount = flag.Int("client", 200, "number of concurrent clients") + argClientCount = flag.Int("client", 2000, "number of concurrent clients") argThreadCount = flag.Int("threads", runtime.NumCPU()*4, "number of threads") argClinetName = flag.String("client-format", "client-%d", "format of client name") argPacketSize = flag.Int("packet-size", 400, "count of metric in packet") argMetricName = flag.String("metric-format", "metric-%d", "format of metric name in packet") - argPacketDelay = flag.Duration("packet-delay", 100*time.Millisecond, "delay of send packet") - argSendTimeout = flag.Duration("packet-send-timeout", 10*time.Millisecond, "packet send timeout") + argPacketDelay = flag.Duration("packet-delay", 60*time.Second, "delay of send packet") argZabbix = flag.String("zabbix", "127.0.0.1:10051", "address of zabbix server") argMaxMetrics = flag.Int("max-metrics", 0, "max number of metrics each client sends") argMaxDuration = flag.Duration("max-duration", 0, "max duration of benchmark test") diff --git a/src/zabbix/sender.go b/src/zabbix/sender.go index 4a0542c..02e347e 100644 --- a/src/zabbix/sender.go +++ b/src/zabbix/sender.go @@ -64,6 +64,6 @@ func (s *Sender) Send(packet *Packet) error { fmt.Fprintf(os.Stderr, "Read zabbix response error: %s\n", err.Error()) } - return nil + return conn.Close() }