[pgrouting-users] RAM needed by 'shortest' for planet database

Moi Lemien hsylvio at gmail.com
Wed Mar 6 09:22:00 PST 2013

Le 25/02/2013 14:41, Stephen Woodbridge a écrit :
> On 2/25/2013 4:22 AM, Tao Romera Martinez wrote:
>> Hello,
>> I am trying to run 'shortest' on a DB with the routing network of the
>> whole planet. I have indices for the id, source, target and geom
>> columns, and apply a window to limit the data I pass to 'shortest'.
>> However, the postgres server crashes unless the source and target
>> nodes are very close.
>> I suspect the problem may come from a lack of RAM since the server
>> only has 1GB, but still have not looked deeper into it. Has anyone
>> put a server running with the whole planet routing network and
>> experienced the same problem? How much memory is needed?
> Yes, this sounds like a reason conclusion. pgRouting has to build a 
> graph in memory before it can solve it so loading very large numbers 
> of vectors into a graph will use a lot of memory. We use the Boost 
> library to build and solve the graph and it does not have any support 
> for paging data into memory as it is needed. Actually none of the 
> other algorithms have that support either.
> You might try something like:
> select edges from streets where near the startpoint
> union
> select edges from streets where near the endpoint
> union
> select edges from streets where highway only
> The idea here is to select all edges near the start and end points, 
> where "near" is a large enough radius to get you into the major roads 
> part of the network, and to only select the major roads network for 
> the rest of the graph. This would eliminate millions of neighborhood 
> streets that you don't car about.
> Turn the above into a query and pass that to you solution.
> -Steve
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users

I was about to give quite the same answer as Stephen.
Another thing you could do if the approach he proposed is not sufficient 
(or not adapted) is to use a part of the server's HDD for swapping.


More information about the Pgrouting-users mailing list