Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

并发情况下队列条目数不对 #14

Open
GoogleCodeExporter opened this issue Jul 28, 2015 · 1 comment
Open

并发情况下队列条目数不对 #14

GoogleCodeExporter opened this issue Jul 28, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. ab -c1000 -n50000 http://ip:port/?name=x&data=somedata&opt=put
2. 看status发现数据条目数往往不对。
3. 同样,可以做下get的测试,往往也是不对的。

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.

—— 1并发的测试  ———–

队列初始信息:

HTTP Simple Queue Service v1.3.1

——————————

Queue Name: x

Maximum number of queues: 1000000

Put position of queue (1st lap): 0

Get position of queue (1st lap): 0

Number of unread queue: 0

尝试1并发的50000次添加:

~/laoyc/soft/bin/ab -c1 -n50000 
“http://192.168.22.31:1218/?name=x&data=1000000000&opt=put”

全部成功,查看队列状态:

HTTP Simple Queue Service v1.3.1

——————————

Queue Name: x

Maximum number of queues: 1000000

Put position of queue (1st lap): 50000

Get position of queue (1st lap): 0

Number of unread queue: 50000

尝试49999次get:

~/laoyc/soft/bin/ab -c1 -n49999 
“http://192.168.22.31:1218/?name=x&data=1000000000&opt=get”

全部成功,再次查看队列状态:

HTTP Simple Queue Service v1.3.1

——————————

Queue Name: x

Maximum number of queues: 1000000

Put position of queue (1st lap): 50000

Get position of queue (1st lap): 49999

Number of unread queue: 1

正确。

在测试一次:发现正确。

————– 1000 并发的测试  ————-

HTTP Simple Queue Service v1.3.1

——————————

Queue Name: x

Maximum number of queues: 1000000

Put position of queue (1st lap): 0

Get position of queue (1st lap): 0

Number of unread queue: 0

开始测试并发1000放50000次:

~/laoyc/soft/bin/ab -c1000 -n50000 
“http://192.168.22.31:1218/?name=x&data=1000000000&opt=put”

发现结果是:

HTTP Simple Queue Service v1.3.1

——————————

Queue Name: x

Maximum number of queues: 1000000

Put position of queue (1st lap): 50020

Get position of queue (1st lap): 0

Number of unread queue: 50020

看起来并发是有问题,现在不确定是ab还是httpsqs的并发处理��
�还是tc的问题。

所以这个队列目前只能应用在缓存和不重要的任务的情景。

1000并行get49999次:

~/laoyc/soft/bin/ab -c1000 -n49999 
“http://192.168.22.31:1218/?name=x&data=1000000000&opt=get”

HTTP Simple Queue Service v1.3.1

——————————

Queue Name: x

Maximum number of queues: 1000000

Put position of queue (1st lap): 50020

Get position of queue (1st lap): 50020

Number of unread queue: 0

可见,get也是不准确的。

Original issue reported on code.google.com by [email protected] on 16 Nov 2010 at 2:07

@GoogleCodeExporter
Copy link
Author

后来同事发现是ab可能有问题。

Original comment by [email protected] on 16 Nov 2010 at 3:24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant