LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-14-2018, 07:59 AM   #1
shlomo.hovir
Member
 
Registered: Oct 2018
Posts: 66

Rep: Reputation: Disabled
dd usage


i posted before a question on reddit about how to stress test a cpu someone recommended me a command dd i knew that he is trying to burn my computer he gave me overrated values can someone explain me bs and count usage because even using manual pages i couldn't understand them and what's the maximum values to test on

bs=BYTES
read and write up to BYTES bytes at a times
count=N
copy only N input blocks
 
Old 10-14-2018, 08:41 AM   #2
FlinchX
Member
 
Registered: Nov 2017
Distribution: Slackware Linux
Posts: 666

Rep: Reputation: Disabled
dd is for copying files, it has nothing to do with stress testing a cpu

when used improperly, it can ruin your filesystems indeed

what exactly do you mean by stress testing a cpu anyway?
 
Old 10-14-2018, 09:42 AM   #3
shlomo.hovir
Member
 
Registered: Oct 2018
Posts: 66

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by FlinchX View Post
dd is for copying files, it has nothing to do with stress testing a cpu

when used improperly, it can ruin your filesystems indeed

what exactly do you mean by stress testing a cpu anyway?
overload cpu with random data came from /dev/urandom
 
Old 10-14-2018, 10:22 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by shlomo.hovir View Post

bs=BYTES
read and write up to BYTES bytes at a times
count=N
copy only N input blocks
bs is block size, count is number of blocks. For example, with bs=1024k and count=100, dd will copy 100 1MB-blocks from input to output.

While I don't know what exactly you want to test, a simpler way of loading the CPU is to run a few yes coommands:
Code:
for i in {1..20}
do
    yes >/dev/null &
done

Last edited by berndbausch; 10-14-2018 at 10:22 AM. Reason: formatting
 
Old 10-14-2018, 11:29 AM   #5
FlinchX
Member
 
Registered: Nov 2017
Distribution: Slackware Linux
Posts: 666

Rep: Reputation: Disabled
Quote:
Originally Posted by shlomo.hovir View Post
overload cpu with random data came from /dev/urandom
I don't understand
 
Old 10-14-2018, 11:51 AM   #6
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
There are specific tools for stress testing in linux, namely stress and stress-ng. They're generally available on most distros. See:

https://linux.die.net/man/1/stress

http://www.ubuntugeek.com/stress-ng-...tu-system.html
 
Old 10-14-2018, 02:24 PM   #7
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
I would use prime95 to stress test a cpu. It's available here: https://www.mersenne.org/download/

dd uses about 4% of the cpu.
 
Old 10-14-2018, 02:44 PM   #8
shlomo.hovir
Member
 
Registered: Oct 2018
Posts: 66

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
bs is block size, count is number of blocks. For example, with bs=1024k and count=100, dd will copy 100 1MB-blocks from input to output.

While I don't know what exactly you want to test, a simpler way of loading the CPU is to run a few yes coommands:
Code:
for i in {1..20}
do
    yes >/dev/null &
done
that doesn't heavy load my cpu
give another suggestion btw i dont want to use software that are used for benchmarking like cpuburn or prime95
 
Old 10-14-2018, 03:03 PM   #9
shlomo.hovir
Member
 
Registered: Oct 2018
Posts: 66

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
bs is block size, count is number of blocks. For example, with bs=1024k and count=100, dd will copy 100 1MB-blocks from input to output.

While I don't know what exactly you want to test, a simpler way of loading the CPU is to run a few yes coommands:
Code:
for i in {1..20}
do
    yes >/dev/null &
done
what does mean blocksize btw
 
Old 10-14-2018, 03:15 PM   #10
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Try
Code:
stress test cpu linux
in your favorite search engine. There are many, many links of advice.
 
Old 10-14-2018, 05:24 PM   #11
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by shlomo.hovir View Post
what does mean blocksize btw
A block is a chunk of data. Blocksize is the number of bytes in a block.

Quote:
that doesn’t heavy load my CPU
How do you measure your CPU load?

If 20 yes processes don’t load your CPU, launch 100 or 1000 processes. Or try dd as you originally planned.
 
Old 10-14-2018, 08:54 PM   #12
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Prime95

Quote:
Originally Posted by shlomo.hovir View Post
btw i dont want to use software that are used for benchmarking like cpuburn or prime95
What actually is the object here? Maybe you could try 'stress-ng'?
 
Old 10-14-2018, 11:42 PM   #13
Honest Abe
Member
 
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Blog Entries: 1

Rep: Reputation: 202Reputation: 202Reputation: 202
@OP,

You may also choose to run the dd command to copy to /dev/null (of=/dev/null). The source (if=) may be /dev/zero or /dev/random or /dev/urandom.
That way, nothing actually gets written (/dev/null is a 'blackhole'), and you may run multiple dd commands in parallel. (append '&' to the end of the command to run it in the background) to overcrowd you BUS IO operation and simulate a stress test.

Of course, this way you shall only be testing a small part of your resources, i.e. IO operation on a disk. For a comprehensive test, you should use a specific tool such as 'stress-ng'. This link should get you started.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script for CPU usage, memory usage, disk partition space and service status reetesh.amity Linux - Server 6 10-12-2015 07:51 PM
processes/CPU Usage/Mem Usage desktop wallpaper ceantuco Linux - Newbie 2 04-13-2009 01:14 PM
X hangs after prolonged usage ... memory usage goes upto 195MB duryodhan Slackware 18 05-10-2007 06:16 PM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 08:43 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration