WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

How can I beyond 600K? #3

@Ranler

Description

@Ranler

OS: CentOS6.2
Kernel: 2.6.32-279.14.1.el6.x86_64
RAM: 32GB ECC
CPU: Xeon E5645 @2.40GHz * 2
JDK: 1.6.0_31

首先第一次按照http://http-kit.org/600k-concurrent-connection-http-kit.html 的设置

客户端基本正常:

...
time 200s, concurrency: 547579, total requests: 2560038, thoughput: 26.39M/s, 12786.00 requests/seconds
time 201s, concurrency: 547779, total requests: 2580908, thoughput: 26.35M/s, 12809.68 requests/seconds
time 202s, concurrency: 548083, total requests: 2598713, thoughput: 26.33M/s, 12816.88 requests/seconds
time 203s, concurrency: 548558, total requests: 2625809, thoughput: 26.42M/s, 12886.39 requests/seconds
time 205s, concurrency: 548709, total requests: 2631873, thoughput: 26.29M/s, 12799.57 requests/seconds
remote closed cleanly
remote closed cleanly
remote closed cleanly
remote closed cleanly
remote closed cleanly
remote closed cleanly
remote closed cleanly

然后服务端就开始报错:

Sat Mar 30 10:06:45 CST 2013 [server-loop] ERROR - queue size exceeds the limit 20480, please increase :queue-size when run-server if this happens often
java.util.concurrent.RejectedExecutionException
        at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1768)
        at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:767)
        at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:658)
        at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:78)
        at org.httpkit.server.RingHandler.handle(RingHandler.java:108)
        at org.httpkit.server.HttpServer.decodeHttp(HttpServer.java:114)
        at org.httpkit.server.HttpServer.doRead(HttpServer.java:168)
        at org.httpkit.server.HttpServer.run(HttpServer.java:239)
        at java.lang.Thread.run(Thread.java:662)
...

第二次,修改main.clj中queue-size

...
(defn -main [& args]
  (run-server (-> handler wrap-keyword-params wrap-params)
              {:port 8000 :queue-size 1024000})
  (println (str "Server started. listen at 0.0.0.0@8000")))

接下来测试正常,客户端:

...
time 353s, concurrency: 597072, total requests: 5530283, thoughput: 32.15M/s, 15656.77 requests/seconds
time 354s, concurrency: 597072, total requests: 5568259, thoughput: 32.16M/s, 15714.85 requests/seconds
time 355s, concurrency: 597072, total requests: 5586378, thoughput: 32.30M/s, 15720.95 requests/seconds
time 356s, concurrency: 597072, total requests: 5604011, thoughput: 32.34M/s, 15724.11 requests/seconds
time 357s, concurrency: 597072, total requests: 5629155, thoughput: 32.38M/s, 15746.50 requests/seconds
time 358s, concurrency: 597072, total requests: 5651914, thoughput: 32.44M/s, 15765.80 requests/seconds

第三次,调整ConcurrencyBench.java下每个IP并发数:

 final static int PER_IP = 25000

基本到了660K就上不去了,一直Connection timed out:

...
time 338s, concurrency: 664873, total requests: 4863842, thoughput: 26.50M/s, 14386.49 requests/seconds
time 339s, concurrency: 664871, total requests: 4867369, thoughput: 26.43M/s, 14354.13 requests/seconds
time 340s, concurrency: 664870, total requests: 4871330, thoughput: 26.35M/s, 14323.02 requests/seconds

现在瓶颈在CPU? 或者通过增加IP地址来提高并发?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions