quantified-uncertainty / metaforecast

Fetch forecasts from prediction markets/forecasting platforms to make them searchable. Integrate these forecasts into other services.
https://metaforecast.org/
MIT License
57 stars 5 forks source link

DB latency #43

Closed berekuk closed 2 years ago

berekuk commented 2 years ago

Continuing from comments on #37.

Heroku<-> DO ping latency is still not good:

> ping({address: 'postgres-green-do-user-11243032-0.b.db.ondigitalocean.com', port: 25060}, (err, data) => {console.log(data)})
undefined
> {
  address: 'postgres-green-do-user-11243032-0.b.db.ondigitalocean.com',
  port: 25060,
  attempts: 10,
  avg: 73.2166266,
  max: 80.681642,
  min: 71.470983,
  results: [
    { seq: 0, time: 71.649331 },
    { seq: 1, time: 72.01795 },
    { seq: 2, time: 71.470983 },
    { seq: 3, time: 71.492197 },
    { seq: 4, time: 71.61182 },
    { seq: 5, time: 71.533632 },
    { seq: 6, time: 74.224676 },
    { seq: 7, time: 73.444478 },
    { seq: 8, time: 80.681642 },
    { seq: 9, time: 74.039557 }
  ]
}

DO instance was in SFO3, and Heroku is US East on AWS.

Turns out DO allows to change the region while keeping the DB available (what kind of black magic is this? I really didn't expect it to work, but I took the risk and changed it to NYC1), will check again after the migration.

berekuk commented 2 years ago

Much better now:

> {
  address: 'postgres-green-do-user-11243032-0.b.db.ondigitalocean.com',
  port: 25060,
  attempts: 10,
  avg: 8.5960293,
  max: 10.444475,
  min: 7.440533,
  results: [
    { seq: 0, time: 9.474809 },
    { seq: 1, time: 7.440533 },
    { seq: 2, time: 7.589693 },
    { seq: 3, time: 7.598009 },
    { seq: 4, time: 7.63105 },
    { seq: 5, time: 9.873495 },
    { seq: 6, time: 9.607855 },
    { seq: 7, time: 8.760061 },
    { seq: 8, time: 7.540313 },
    { seq: 9, time: 10.444475 }
  ]
}
NunoSempere commented 2 years ago

Turns out DO allows to change the region while keeping the DB available (what kind of black magic is this?

Huh, curious