HSLdevcom / transitlog

Explore observed public transport and compare with the intended traffic
https://reittiloki.hsl.fi/
Creative Commons Attribution 4.0 International
5 stars 1 forks source link

Increase HFP api timeout #14

Closed danieldunderfelt closed 5 years ago

danieldunderfelt commented 5 years ago

Edit: as a priority, the timeout should be increased. It feels like Hasura could provide a response with a larger timeout.

Some features in the transitlog-ui require data for a full day, and Hasura/Postgres does not seem to be able to handle queries with only a where clause for the oday column. Any query that is only limited to a day with no other where clauses results in a timeout. Adding limit does not help.

Example query:

query vehiclesQuery($date: date) {
  vehicles(
    distinct_on: [unique_vehicle_id]
    order_by: [{unique_vehicle_id: asc}]
    where: {oday: {_eq: $date}}
  ) {
    oday
    unique_vehicle_id
    vehicle_number
    owner_operator_id
  }
}

Not sure that the solution is. Maybe Postgres or hasura just need more RAM or the timeout needs to be increased. Indices should also be added to the columns that are queried for the most.

paasovaara commented 5 years ago

done, now 60 secs. we should however not keep this long in production.