GNU/Linux >> Linux の 問題 >  >> Ubuntu

Ubuntu –このプロセスで正確に起こっていますか?

そこで、次のコマンドを実行しましたが、誤ってモニターを見て、正確に何が起こっているのか疑問に思いました。ここで何が起こっているのか、誰かが私に説明してもらえますか?

echo "`seq 100000000 -1 1`" > file

画像が読み込まれないことがよくあるので、画像に何が表示されているかを説明しようとしています。メモリ使用量は直線的に増加し、CPU1使用量は100%に固定されます。その後、t1(ほとんど目立たない)t2 t3 t4 t5の時点で、メモリ使用量は約0.5秒間急激に増加し、CPU1使用量は減少し、CPU2使用量はすべて増加します。同時に、メモリの増加率はまったく同じ勾配の線形形式に戻り、CPU1の使用量は再び100%に向かって増加し、CPU2の使用量はさらに0.5秒で以前の状態に低下します。興味深い点は次のとおりです。

t(i)-t(i-1) = 2*(t(i+1)-t(i))     for every i
The amount of decrease in CPU1 usage doubles for each i
The time interval in which these things take seems to be the same for all i
The amount of sudden growth in memory usage also doubles for all i
The sum of the loads of CPU1 and CPU2 seem to be constant in time.

ですから、1つの質問で複数の質問をしているのですが、これが最善の方法だと思います。ほぼ同じ説明で同じ写真を5回投稿するのではなく。

誰かが私に説明してもらえますか?なぜこれらの観察が正確に行われているのですか?

メモリ情報:

$ sudo lshw -class memory
  *-firmware              
       description: BIOS
       vendor: LENOVO
       physical id: 0
       version: 9ECN31WW(V1.14)
       date: 08/18/2014
       size: 128KiB
       capacity: 6592KiB
       capabilities: pci upgrade shadowing cdboot bootselect edd int13floppynec int13floppytoshiba int13floppy360 int13floppy1200 int13floppy720 int13floppy2880 int9keyboard int10video acpi usb biosbootspecification uefi
  *-cache:0
       description: L1 cache
       physical id: b
       slot: L1 Cache
       size: 32KiB
       capacity: 32KiB
       capabilities: synchronous internal write-back instruction
       configuration: level=1
  *-cache:1
       description: L2 cache
       physical id: c
       slot: L2 Cache
       size: 256KiB
       capacity: 256KiB
       capabilities: synchronous internal write-back unified
       configuration: level=2
  *-cache:2
       description: L3 cache
       physical id: d
       slot: L3 Cache
       size: 6MiB
       capacity: 6MiB
       capabilities: synchronous internal write-back unified
       configuration: level=3
  *-cache
       description: L1 cache
       physical id: a
       slot: L1 Cache
       size: 32KiB
       capacity: 32KiB
       capabilities: synchronous internal write-back data
       configuration: level=1
  *-memory
       description: System Memory
       physical id: 2a
       slot: System board or motherboard
       size: 8GiB
     *-bank:0
          description: SODIMM DDR3 Synchronous 1600 MHz (0.6 ns)
          product: HMT451S6BFR8A-PB
          vendor: Unknown
          physical id: 0
          serial: 1E52E0EA
          slot: DIMM0
          size: 4GiB
          width: 64 bits
          clock: 1600MHz (0.6ns)
     *-bank:1
          description: DIMM [empty]
          product: Empty
          vendor: Empty
          physical id: 1
          serial: Empty
          slot: DIMM1
     *-bank:2
          description: SODIMM DDR3 Synchronous 1600 MHz (0.6 ns)
          product: HMT451S6BFR8A-PB
          vendor: Unknown
          physical id: 2
          serial: 1E82E0B8
          slot: DIMM2
          size: 4GiB
          width: 64 bits
          clock: 1600MHz (0.6ns)
     *-bank:3
          description: DIMM [empty]
          product: Empty
          vendor: Empty
          physical id: 3
          serial: Empty
          slot: DIMM3

CPU情報:

$ sudo lshw -class processor
  *-cpu                   
       description: CPU
       product: Intel(R) Core(TM) i7-4700HQ CPU @ 2.40GHz
       vendor: Intel Corp.
       physical id: 4
       bus info: [email protected]
       version: Intel(R) Core(TM) i7-4700HQ CPU @ 2.40GHz
       serial: To Be Filled By O.E.M.
       slot: U3E1
       size: 3285MHz
       capacity: 3400MHz
       width: 64 bits
       clock: 100MHz
       capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts cpufreq
       configuration: cores=4 enabledcores=4 threads=8

カーネルとOSの情報

$ uname -a
Linux <Machine name> 4.10.0-42-generic #46~16.04.1-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux

シェル情報:

$ $SHELL --version
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)

スワップ情報:

$ lsblk | grep SWAP
├─sda2   8:2    0   935M  0 part [SWAP]

承認された回答:

最大848MBの出力を生成するコマンドを実行しており、それをechoのシェルコマンドライン引数に補間しようとしています。 次に、それをファイルにリダイレクトします。 (ところで、最新のシステムの最新のシェルでは、最大数メガバイトのコマンドラインが許可されますが、ギガバイト近くのコマンドラインは許可されません)。

関連:Fedora – Fedora 26へのアップグレード後にvboxnetインターフェースがありませんか?

これが膨大な量のRAMとCPUパワーを使用することに驚く理由はありますか?

seq 100000000 -1 1 > fileを実行していても かなりの時間がかかりますが、コマンド置換がなければ、出力をメモリに保持する必要がないため、メモリ使用量はそれほど多くありません。

例えば私のAMDPhenomII 1090Tでは、seqの実行に1分2秒かかります コマンドを実行し、その出力をファイルにリダイレクトします:

$ time seq 100000000 -1 1 > /tmp/seq.test

real 1m2.136s   user 1m0.215s   sys 0m1.405s
$ ls -lh /tmp/seq.test 
-rw-r--r-- 1 cas cas 848M Jan  8 12:06 /tmp/seq.test

Ubuntu
  1. Ubuntu 20.04 LTSにIcingaをインストールします-ステップバイステップのプロセス?

  2. Ubuntu 18.04 / 20.04/21.04にOracleJava16をインストールします-ステップバイステップのプロセス?

  3. Ubuntu 20.04にLaravelをインストールする-ステップバイステップのプロセス?

  1. Ubuntu20.04にEclipseIDEをインストールします-ステップバイステップのプロセス?

  2. Ubuntu 20.04にGrafanaをインストールします-ステップバイステップのプロセス?

  3. Ubuntu 20.04でデスクトップの背景を変更する-これを行う手順は?

  1. Ubuntu20.04にApacheKafkaをインストールして構成します-このタスクを実装するためのステップバイステップのプロセス?

  2. 新しいYogaX1Gen 5ランダムフリーズ、Ubuntu 20.04?

  3. Ubuntu Linux でのプロセスの管理