Tag Info

Hot answers tagged

15

Izkata's comment revealed the answer: locale-specific comparisons. The sort command uses the locale indicated by the environment, whereas Python defaults to a byte order comparison. Comparing UTF-8 strings is harder than comparing byte strings. $ time (LC_ALL=C sort <numbers.txt >s2.txt) real 0m5.485s user 0m14.028s sys 0m0.404s How about ...


9

If you just want to time the lookup of a single record, use time dig a foobar.com @8.8.8.8. This testing method really isn't that good since after the first lookup, you'll be getting cached results and whatever server is closer to you will give you the fastest response. namebench is probably the tool you're looking. It does lookups based on domains are in ...


8

I usually use hdparm to benchmark my HDD's. You can benchmark both the direct reads and the cached reads. You'll want to run the commands a couple of times to establish an average value. Examples Here's a direct read. $ sudo hdparm -t /dev/sda2 /dev/sda2: Timing buffered disk reads: 302 MB in 3.00 seconds = 100.58 MB/sec And here's a cached read. $ ...


7

No. Process/context switches aren't free. How much other processes running will slow yours down is very system-dependent, but it consists of things like: Every time a processor switches to a different address space (including process), then the MMU cache must be flushed. And probably the processor L1 caches. And maybe the L2 and L3 caches. This will slow ...


7

This is more of an extra analysis than an actual answer but it does seem to vary depending on the data being sorted. First, a base reading: $ printf "%s\n" {1..1000000} > numbers.txt $ time python sort.py <numbers.txt >s1.txt real 0m0.521s user 0m0.216s sys 0m0.100s $ time sort <numbers.txt >s2.txt real 0m3.708s user ...


6

From https://blogs.oracle.com/ksplice/entry/disown_zombie_children_and_the A process is put in an uninterruptible sleep (STAT D) when it needs to wait on something (typically I/O) and shouldn't be handling signals while waiting. This means you can't kill it, because all kill does is send it signals. This might happen in the real world if you unplug your NFS ...


5

Not sure I understand your question fully, but what about: find . -type f -exec pv -N {} {} \; > /dev/null Gives an output like: ./file1: 575kB 0:00:00 [1.71GB/s] [=======================>] 100% ./file2: 15.2GB 0:00:07 [2.22GB/s] [==> ] 15% ETA 0:00:38


5

Both of the implementations are in C, so a level playing field there. Coreutils sort apparently uses the mergesort algorithm. Mergesort does a fixed number of comparisons which increases logarithmically to the input size, i.e. big O(n log n). Python's sort uses a unique hybrid merge/insertion sort, timsort, which will do a variable number of comparisons ...


4

The goto for Linux is cpuburn (homepage). I would expect that it should work on other UNIX systems as well.


4

This means stuff overflowed and the calculations are meaningless. If you want to get meaningful figures on the read test, you need to make sure the file size is much larger than your RAM, otherwise all you're testing is essentially your RAM speed and the kernel's caching algorithms. Try booting with mem=256M at the end of the kernel boot line, and re-run ...


4

Check the Linux Benchmark Suite page. It has links to a bunch of benchmarks, including bonie and bonie++ which can do what you want (and more). For bonnie++, to change the block size, you might also need to specify the test file size. usage: bonnie++ [-d scratch-dir] [-s size(MiB)[:chunk-size(b)]] So bonnie++ ... -s 1g:4k ... should do I/O in 4096 byte ...


3

That would be a job for bonnie++. There are other benchmark tools of course but this one does exactly what you listed and is sort of a de-facto starting place for read/write bench-marking disks.


3

It's not exactly a UNIX or GNU/Linux tool, but you could quite comfortably use the R software environment for statistical computing for this. (I cannot find anything more specific for your task, though.) Edit How could I doubt it, there of course is a benchmark package for R: rbenchmark. It apparently wraps system.time() which you could also just use ...


3

There is a memory bandwidth benchmark available in open source. It works for Intel & ARM under Linux or Windows Mobile CE. It will give you raw performance for your memory as well as system performance with memory. But it won't give you a real-time bandwidth, so I don't know if it's a good answer to your question. There's also a memtop tool out there, ...


3

I also advise you to use other tools for benchmarking I/O than dd. Brtfs is not a traditional filesystem and being a copy-on-write and transactional filesystem, most of the operations are done in memory and not directly on the hdds. So when you issue the deletes and recreate the file, I believe it will just reuse what is has in memory. Let's not forget that ...


3

Computing time in nanoseconds under GNU/Linux, using bash. WARNING This post was rendered obsolet by a new nice method discussed there: Profiling bash (3 answers)and with full ready-to-use bash source file there: Elap-bash V3 Ways to retrieve reliable values There are some way to ask for time in a finer granularity than one second. First, but not best: ...


3

If all you want is elapsed time, then with zsh or ksh93: $ typeset -F SECONDS=0; sleep 1; print "$SECONDS" 1.0012850761 Now, whether that kind of precision makes sense is another matter.


3

with the IOPS tool If you can't be bothered to read all this I'd just recommend the IOPS tool. It will tell you real-world speed depending on block size. Otherwise - when doing an IO benchmark I would look at the following things: blocksize/cache/IOPS/direct vs buffered/async vs sync read/write threads latency CPU utilization Which blocksize will you ...


2

stress is pretty good. I see no reason to use something else.


2

While you could test all of those independently I would recommend the Phoronix Test Suite. From the Site: The Phoronix Test Suite is the most comprehensive testing and benchmarking platform available that provides an extensible framework for which new tests can be easily added. The software is designed to effectively carry out both qualitative and ...


2

That depends on what exactly are you looking for. For trivial system load monitoring there is top and a more nifty htop. Then there a dozens of specialized monitors for network, I/O, battery consumption... If you are actually looking for performance holes in the software, you would need a profiler. For network software, the only free usable profile is ...


2

Consider that in today's machines one real memory access is worth a few hundred instructions, the benchmark results probably depend much more on CPU and cache behaviour than RAM speed. And the speed might be limited by the motherboard's handling of RAM too.


2

The package hardinfo (http://sourceforge.net/projects/hardinfo.berlios/) is a pretty decent system benchmarker with a nice GUI. The simplest way to compare the two would be to benchmark one save the results and then compare it to your benchmarking of the other. EDIT Depending on your distro, you may already have hardinfo installed, for example on Lubuntu ...


2

You Can use the folllowing command: dig YOURDOMAIN +nssearch


2

I would not rely on this software for benchmarking on linux. Here is a thread of complaints about the fact that geekbench mysterious profiles 32-bit linux systems faster than 64-bit systems on the same 64-bit hardware. I suppose it's not inconceivable that that be accurate, but it seems pretty unlikely that gcc -- which compiles all GNU/linux binary ...


2

I was unable to find anything convincing either with respect to X, Wayland, and Mir. I did find this case study that showed the differences between X11 SSH, FreeNX, and VNC. http://vis.lbl.gov/Events/SC08/RemoteX/index.html ...


2

for benchamrking purposes you should disable syn_cookies: echo 0 > /proc/sys/net/ipv4/tcp_syncookies But re-enable them if you're done! If the server can't take the load you have to optimize your webapp, tune your config, use some kind of caching or use more than one server fronted by a loadbalancer. I can't tell more detals because it highly depends ...


2

This behaviour is because BTRFS supports sparse files. Basically, any sufficiently long string of "empty space" (0 bits) will be stored as metadata saying "from this point to this other point is all 0s" instead of actually writing the 0s to disk. In this case, as your input stream is /dev/zero, your entire file is 0s, and thusly its actual size on disk is ...


2

Does this imply that 'user' and 'sys' will be unaffected by other processes? user time can't really be affected by anything else directly. sys time can, since it may include I/O. If there are a bunch of processes trying to access a device at once, the device itself may become busy, such that when your process is actively scheduled, the system has to ...


2

See if bonnie++ gives you the tests/results you're looking for. Bonnie++ may be available from your distro's repos. This article, SSD Linux benchmarking: Comparing filesystems and encryption methods may also be interesting to you.



Only top voted, non community-wiki answers of a minimum length are eligible