[PDB-tech] peeringdb-py feedback

Chris Caputo ccaputo at alt.net
Wed Mar 16 02:55:11 PDT 2016

I am happy to report the Seattle IX is now utilizing PeeringDB 2.0 to 
supplement its web site and route server configs.

In case useful for other sites, my total development time to change from 
PDB 1.0's mysql tables to installing and using peeringdb-py with sqlite 
was under 3.5 hours.

Some feedback to the creators of peeringdb-py:

The "updated" field in the local database, for each table, appears to be 
based on when the local database is updated, rather than based on the 
dates garnered by the sync.  Can it be made to match the web site?  
(Same for "created".)

For peeringdb-py it may be useful to make it so diagnostic output is all 
to stdout, while errors are to stderr.  That way folks using it in a 
crontab with "peeringdb sync > /dev/null" won't get an email unless there 
is an actual error logged to stderr.  And in that case the email will be 
useful for chasing down the error.  These lines are going to stderr, when 
they would best be going to stdout:

  Starting new HTTPS connection (1): www.peeringdb.com
  "GET /api/org?since=1458111034 HTTP/1.1" 200 None

For the crontab example at:


it may be a good idea to avoid a thundering herd, from everyone following 
that example, by having a random duration sleep of between 0 and 10 
minutes.  For example:

  crontab -l | { cat; echo "0 0 * * * sleep \$[RANDOM\%600] ; `which peeringdb` sync > /dev/null 2>&1"; } | crontab -

(Remove the '2>&1' if #2 suggestion is accepted.)


More information about the Pdb-tech mailing list