This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Control osmosis “multithreading”

0

I would like to control how much CPUs osmosis can use?

My typicaly run looks like:

bin/osmosis --rb inputs/france.pbf --lp \
            --tf reject-relations --lp \
            --tf accept-ways highway=motorway,trunk,primary,secondary \ # maybe more...
                 natural=coastline junction=roundabout --lp \
            --used-node --lp \
            --osm2graph file=france.mapgr id=FR name=France

The last task (osm2graph) is single-threaded but when I run this on a 8-cores machine, I get CPU usage above 100%.

I plan on running osmosis on a shared platform, so I need to either control its CPU usage, or know its maximum CPU usage so that I can reserve enough without impacting other users.

Is there a way to tell osmosis not to use more than X CPUs/Threads? Or to know how much osmosis is going to use?

asked 08 Mar '18, 11:03

Holt59's gravatar image

Holt59
11113
accept rate: 0%

edited 08 Mar '18, 11:03

You can use the tool cpulimit to limit the CPU usage of arbitrary processes. A more advanced way is to use cgroups if your kernel supports them.

(08 Mar '18, 12:20) scai ♦

Source code available on GitHub .