Travel Mapping

User Discussions => Other Discussion => Topic started by: yakra on January 04, 2023, 10:29:51 am

Title: siteupdate performance: CentOS 7 vs Ubuntu 18.04 LTS vs FreeBSD 13.0
Post by: yakra on January 04, 2023, 10:29:51 am
A comparison of siteupdate's multi-threaded performance under Centos, Ubuntu and FreeBSD on the same machine.
Tests were run on a Dell PowerEdge R420 with Dual Xeon E5-2420 CPUs & 12x4GB DDR3-1333 RAM (I can try to find out the timings if anyone wants).
Hard disks: The Linux (CentOS & Ubuntu) installs are on identical Savvio 15K.3s, whereas FreeBSD is on a Kingston HyperX SH103S3/120G. However, all stats CSVs, logs other than siteupdate, nmp_merged files, and graphs were written to /dev/null.

Info from uname -a and clang --version:

Commit info:
HighwayData:    972df9bb65bf0a270b4fc00dcae30b1823ea484b
UserData:       d721ce609a34bd274bc48940f876f51564a89a94
DataProcessing: fbed09107b80b89cc1d2ecf9bb2b9c5a608c1062


Method:
The siteupdate executable was renamed siteupdate_fbed0.
check10.sh --null -v -tp 3 _fbed0 (https://github.com/yakra/tmtools/blob/89133b1/shell_scripts/check10.sh) was used to automate 240 runs of siteupdate on each OS, 10 for each number of threads, saving siteupdate.log each time.
For each task, table.sh (https://github.com/yakra/tmtools/blob/89133b1/shell_scripts/table.sh) was used to iterate through each number of threads, find the before & after timestamps in siteupdate.log, calculate the time spent on the task in each of the 10 passes, then average all 10 passes together.
Title: Re: siteupdate performance: CentOS 7 vs Ubuntu 18.04 LTS vs FreeBSD 13.0
Post by: yakra on January 04, 2023, 10:30:53 am
ReadWptThread: Reading waypoints for all routes.
(https://forum.travelmapping.net/index.php?action=dlattach;topic=5349.0;attach=576)
Title: Re: siteupdate performance: CentOS 7 vs Ubuntu 18.04 LTS vs FreeBSD 13.0
Post by: yakra on January 04, 2023, 10:32:09 am
WaypointQuadtree::sortnodes: Sorting waypoints in Quadtree.
(https://forum.travelmapping.net/index.php?action=dlattach;topic=5349.0;attach=578)
Title: Re: siteupdate performance: CentOS 7 vs Ubuntu 18.04 LTS vs FreeBSD 13.0
Post by: yakra on January 04, 2023, 10:32:44 am
NmpSearchThread: Searching for near-miss points.
(https://forum.travelmapping.net/index.php?action=dlattach;topic=5349.0;attach=580)
Title: Re: siteupdate performance: CentOS 7 vs Ubuntu 18.04 LTS vs FreeBSD 13.0
Post by: yakra on January 04, 2023, 10:33:28 am
NmpMergedThread: Writing near-miss point merged wpt files.
(https://forum.travelmapping.net/index.php?action=dlattach;topic=5349.0;attach=582)
Title: Re: siteupdate performance: CentOS 7 vs Ubuntu 18.04 LTS vs FreeBSD 13.0
Post by: yakra on January 04, 2023, 10:34:17 am
RteIntThread: Creating label hashes and checking route integrity.
(https://forum.travelmapping.net/index.php?action=dlattach;topic=5349.0;attach=584)
Title: Re: siteupdate performance: CentOS 7 vs Ubuntu 18.04 LTS vs FreeBSD 13.0
Post by: yakra on January 04, 2023, 10:34:58 am
ReadListThread: Processing traveler list files
(https://forum.travelmapping.net/index.php?action=dlattach;topic=5349.0;attach=586)
Title: Re: siteupdate performance: CentOS 7 vs Ubuntu 18.04 LTS vs FreeBSD 13.0
Post by: yakra on January 04, 2023, 10:35:24 am
ConcAugThread: Augmenting travelers for detected concurrent segments.
(https://forum.travelmapping.net/index.php?action=dlattach;topic=5349.0;attach=588)
Title: Re: siteupdate performance: CentOS 7 vs Ubuntu 18.04 LTS vs FreeBSD 13.0
Post by: yakra on January 04, 2023, 10:35:52 am
CompStatsRThread: Performing per-route data checks and computing stats.
(https://forum.travelmapping.net/index.php?action=dlattach;topic=5349.0;attach=590)
Title: Re: siteupdate performance: CentOS 7 vs Ubuntu 18.04 LTS vs FreeBSD 13.0
Post by: yakra on January 04, 2023, 10:36:17 am
CompStatsTThread: Computing stats per traveler.
(https://forum.travelmapping.net/index.php?action=dlattach;topic=5349.0;attach=592)
Title: Re: siteupdate performance: CentOS 7 vs Ubuntu 18.04 LTS vs FreeBSD 13.0
Post by: yakra on January 04, 2023, 10:36:40 am
UserLogThread: Creating per-traveler stats logs and augmenting data structure.
(https://forum.travelmapping.net/index.php?action=dlattach;topic=5349.0;attach=594)
Edit: Storing & referencing a system_region_mileages iterator didn't really pan out, with the caveat that I've yet to test it out on my laptop. That has only 512K L2 cache, so it may help there.
That aside, I have some other tricks up my sleeve that may improve efficiency and help FreeBSD scale a little better.
Title: Re: siteupdate performance: CentOS 7 vs Ubuntu 18.04 LTS vs FreeBSD 13.0
Post by: yakra on January 04, 2023, 10:37:04 am
HighwayGraph::simplify: Creating unique names and vertices
(https://forum.travelmapping.net/index.php?action=dlattach;topic=5349.0;attach=596)
Title: Re: siteupdate performance: CentOS 7 vs Ubuntu 18.04 LTS vs FreeBSD 13.0
Post by: yakra on January 04, 2023, 10:37:28 am
SubgraphThread: (creating & writing all subgraphs)
MasterTmgThread & SubgraphThread: (writing all .tmg files)
(https://forum.travelmapping.net/index.php?action=dlattach;topic=5349.0;attach=610)
Title: Re: siteupdate performance: CentOS 7 vs Ubuntu 18.04 LTS vs FreeBSD 13.0
Post by: yakra on January 04, 2023, 10:37:51 am
Subtotal: of all the above threaded tasks combined
(https://forum.travelmapping.net/index.php?action=dlattach;topic=5349.0;attach=612)
Title: Re: siteupdate performance: CentOS 7 vs Ubuntu 18.04 LTS vs FreeBSD 13.0
Post by: yakra on January 04, 2023, 10:38:20 am
Total run time:
(https://forum.travelmapping.net/index.php?action=dlattach;topic=5349.0;attach=602)
Edit #2: A couple charts are now fixed. Edit #1 below was written before fixing them.
Edit #1: Eagle-eyed observers may notice some oddities with FreeBSD in the last two charts.
The combined subtotal of all the threaded tasks (https://forum.travelmapping.net/index.php?topic=5349.msg30153#msg30153) takes longer at 2 threads than 1 (thanks in no small part to graph generation's poor scaling).
Yet the total run time is faster at 2 threads than 1. How is this possible?

I picked the wrong timestamp to measure graph generation speed; I shouldn't be measuring just the subgraphs.
At 2+ threads, the master graph files are written alongside subgraphs -- numthreads-1 SubgraphThreads are spawned along with one MasterTmgThread, which spawns another SubgraphThread when it finishes. Meaning, when numthreads = 1, no SubgraphThreads are spawned until MasterTmgThread finishes.
At 2+ threads, the master graphs are started at the same time as the continent graphs (https://github.com/yakra/tmtools/blob/89133b1/shell_scripts/table.sh#L19), so my measurement will include time spent writing the master graphs too.
At 1 thread, the master graphs are finished before the continent graphs start. This makes our 1-thread figures look faster than they should compared to 2+ threads, as we're processing a smaller amount of data.
Writing the master graph files has to happen somewhere -- where is it? It's after the "Setting up subgraphs" message is printed. Indeed if we use table.sh to measure the time spent on this "single-threaded" task, it's 15s @ 1 thread, and hovers around 0.02s from 2 to 24 threads. I think it's acceptable to include this time in our total graph generation figures. ;)

So yeah, I'll run table.sh again with new timestamps, and fix the charts. Changes I expect to see: