服务器停止响应问题处在于什么地方,为什么简单瘦服务器在基准测试时在16500个请求处停止响应?...

这里有一个简单的测试服务器:

require 'rubygems'

require 'rack'

require 'thin'

class HelloWorld

def call(env)

[200, {"Content-Type" => "text/plain"}, "OK"]

end

end

Rack::Handler::Thin.run HelloWorld.new, :Port => 9294

#I've tried with these added too, 'rack.multithread' => true, 'rack.multiprocess' => true

这是一个测试运行:

$ ab -n 20000 http://0.0.0.0:9294/sdf

This is ApacheBench, Version 2.3

Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 0.0.0.0 (be patient)

Completed 2000 requests

Completed 4000 requests

Completed 6000 requests

Completed 8000 requests

Completed 10000 requests

Completed 12000 requests

Completed 14000 requests

Completed 16000 requests

apr_poll: The timeout specified has expired (70007)

Total of 16347 requests completed

它在16500左右分解。为什么?我怎么知道发生了什么事。 GC是红宝石还是OS X机器上可用网络插座的数量?我有一个MPB 2.5 Ghz 6G内存。

编辑

这里经过一番讨论和测试不同的东西,这似乎是从15000变化net.inet.tcp.msl到1000毫秒,使测试与AB高频Web服务器消失的问题。

sudo sysctl -w net.inet.tcp.msl=1000 # this is only good for local development

+1

你找不到原因?潜在的解释可能是操作系统将套接字保持在“最近使用”状态,并且不会在几分钟内重用它。显然,人们可以重新配置操作系统的IP层不这样做。 –

2012-09-16 08:12:47

+1

如果有帮助,我可以在我的MBP上重现这种确切的行为。 16359个请求完成。不知道是什么原因造成的。 –

2012-09-16 08:39:21

+1

嗯,想出来大声,这个数字是可疑接近16384 ... –

2012-09-16 08:42:41

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值