New answers tagged

2

As it is speed what you are looking for: We can do one host call with -t ANY instead of the four used now hoping to get all the four resolutions in one. That will need parsing of the answer. If the whois call could be started and while waiting for an answer from the whois servers we can make the host calls to the DNS servers, we can get the fastest ...


1

I'm not trying to outdo the accepted answer - there is a good answer already, but this was too long for a comment and I thought it might be useful. A significant speedup would result from reducing the 4 calls to host into one call to dig (or host, but the output is easier to handle from dig). Backgrounding the 4 calls will speed things up as the 4 calls ...


3

That's 4 uses of host and one of whois. The only way you could speed that up would be to run the commands as background jobs and arrange to check for their completion. That would be a rewrite, which the question declines. To make a background job of each, you'd do something like this, redirecting output to temporary files: ( host -t mx $inp ...


1

It is not clear if you search for page in/out caused by paging or by swapping. The difference is explained at several places here (http://superuser.com/questions/785447). The number of pages swapped and paged from /proc/vmstat. Pages paged in / out $ cat /proc/vmstat|grep pgpg pgpgin 6920262 pgpgout 345654122 Pages swapped in / out $ cat ...


2

Subshells do have overhead. On my system, the minimal fork-exec cost (when you run a program from disk when the file ins't cold) is about 2ms and the minimal forking cost is about 1ms. With subshells, you're talking the forking cost alone, as no file needs to be execed. If the subshells are kept reasonable low, 1ms is quite negligible in human-facing ...


3

You can read about the hash tree index used for directories here. A linear array of directory entries isn't great for performance, so a new feature was added to ext3 to provide a faster (but peculiar) balanced tree keyed off a hash of the directory entry name.


2

iotop shows statistics from several different origins; take care when adding up stuff. This previous discussion covers the difference between per-process read/write amounts and the system total read/write amounts: they cover different stuff since the per-process amounts include all I/O (whether to disk, to cache, to network, etc.) whereas the system total ...


3

I don't think there is a way to limit swap space, unless you modify the program to only request non-swappable memory, which even if possible would probably be impractical. However what you can and should do is limit the total amount of memory available to the process. You can use cgroups (the new-ish general way), ulimit (setrlimit, the traditional way), or ...


0

If you want to save the data for long term evaluation, you could use munin to graph it. I haven't seen plugins for GPUs, but since you figured out how to get the data, it isn't a big deal to write a munin plugin: http://munin-monitoring.org/wiki/HowToWritePlugins


1

The read-only test only reads. That's basically the default testing method for just about everything and pretty much the same what disks do for SMART self-tests. The non-destructive read-write test works by overwriting data, then reading to verify, and then writing the original data back afterwards. The only way to verify that writing data works is by ...


12

GNU find has an optimization which can be applied to find . but not to find . -type f: if it knows that none of the remaining entries in a directory are directories, then it doesn't bother to determine the file type (with the stat system call) unless one of the search criteria requires it. Calling stat can take measurable time since the information is ...



Top 50 recent answers are included