Running several AWK scripts at the same time with

2019-08-19 08:17发布

So I want to run 4 AWK scripts at the same time so that they run in parallel on all my CPU cores. This should lower my runtime to 25% of the total runtime, which means it only has to run for approximately 24 hours (instead of 4 days). Now all works fine, but when I do this I would obviously get a 100% CPU load for 24 hours.

I have never done this before and I'm planning on starting the scripts tonight so I can keep them running overnight and tomorrow during the day. Now I'm a bit afraid that I am going to destroy my CPU in doing this?

I assume that I risk my CPU getting overheated? Am I correct in assuming this? And if so, would it be smarter to run 3 at the time instead of 4 to keep the load at 75%?

Might be a very basic question, but I figured I should find this out before I destroy my computer haha :)

TL;DR: Should I leave my CPU at 100% load for 24 hours or is this going to destroy my CPU?

CPU: Intel Core i5-4570 3.20GHz (4 CPUs) (stock, never overclocked it or anything)

Edit:

This is the AWK script I am running:

BEGIN { IGNORECASE = 1 }  # ignoring the case
       NR==FNR { a[$1]; next }   # hash csv to a hash
       {
           for(i in a) {          # each entry in a
               if($0 ~ i) {      # check against every record of ttl
                   print >> "testrunawk1.txt"        # if match, output matched ttl record
                   next          # skip to next ttl record
               }
            }
       }

I made 4 versions of this script that create files "testrunawk1.txt", "testrunawk2.txt", etc.

I have 4 .txt files that include lines in the following format:

/resource/text_(moretext) 

These 4 txt files are compared with a .TTL file and as you can see in the AWK script the lines from the .txt file that are also found in the .TTL file are then outputted into another file (testrunawk1.txt).

Like I said this all works perfectly, it just has a long runtime due to the files being millions of lines long. This is why I split my .txt file into 4 seperate files and run them in seperate CMD's (to allow more than 1 CPU core to be used and run them in parallel).

So just to be clear, I'm not looking for help in my script code (unless you think it can be made faster). I am just wondering if forcing my CPU to run at 100% load for 24 hours will destroy my CPU :)

标签: cpu-usage
0条回答
登录 后发表回答