1

現在、gwan Web サーバーをテストしています。gwan ワーカーのデフォルト設定と CPU コア検出について質問があります。

Xen サーバー (4 コアの Xeon CPU を搭載) で gwan を実行するとgwan.log、単一のコアしか検出されなかったことがファイルによって報告されます。

'./gwan -w 4' used to override 1 x 1-Core CPU(s)
[Wed May 22 06:54:29 2013 GMT]   using   1 workers 0[01]0
[Wed May 22 06:54:29 2013 GMT]   among   2 threads 0[11]1
[Wed May 22 06:54:29 2013 GMT]   (can't use more threads than CPU Cores)

[Wed May 22 06:54:29 2013 GMT] CPU: 1x Intel(R) Xeon(R) CPU E5506 @ 2.13GHz
[Wed May 22 06:54:29 2013 GMT]  0 id: 0     0
[Wed May 22 06:54:29 2013 GMT]  1 id: 1     1
[Wed May 22 06:54:29 2013 GMT]  2 id: 2     2
[Wed May 22 06:54:29 2013 GMT]  3 id: 3     3
[Wed May 22 06:54:29 2013 GMT] CPU(s):1, Core(s)/CPU:1, Thread(s)/Core:2

何か案が?

ありがとう!!

4

1 に答える 1

1

gwan.log ファイルには、コアが 1 つしかないことが報告されています。

Xenは、他の多くのハイパーバイザーと同様に、CPUID命令と/proc/cpuinfoLinux カーネル構造 (どちらも G-WAN が CPU コアを検出するために使用する) を壊しています。

これまで見てきたように、これは、マルチコアで拡張するように設計されたマルチスレッド アプリケーションにとって、実際の問題です。

'./gwan -w 4' は、1 x 1 コア CPU をオーバーライドするために使用されます

ばかげた手動オーバーライドによるメモリの浪費とパフォーマンスへの影響を回避するために、G-WAN はユーザーが指定したスレッド数が実際の CPU コア数を超えていないことを確認します。

これが、 「(CPU コアよりも多くのスレッドを使用することはできません)」という警告が表示される理由です。

この保護と警告をバイパスするには、-g("God") モードを使用できます。

./gwan -g -w 4

このコマンド ライン スイッチは、G-WAN 実行可能ヘルプに記載されています。

./gwan -h

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Usage: gwan [-b -d -g -k -r -t -v -w] [argument]
(grouped options '-bd' are ignored, use '-b -d')

  -b: use the TCP_DEFER_ACCEPT TCP option
      (this is disabling the DoS shield!)

  -d: daemon mode (uses an 'angel' process)
      -d:group:user dumps 'root' privileges

  -g: do not limit worker threads to Cores
      (using more threads than physical Cores
       will lower speed and waste resources)

  -k: (gracefully) kill local gwan processes
      using the pid files of the gwan folder

  -r: run the specified C script (and exit)
      for general-purpose code, not servlets

  -t: store client requests in 'trace' file
      (may be useful to debug/trace attacks)

  -v: return version number and build date

  -w: define the number of worker threads.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Available network interfaces (2):
127.0.0.1 192.168.0.11 
于 2013-05-22T09:57:11.323 に答える