bcgov / nr-fom

Forestry Operations Map
Apache License 2.0
0 stars 1 forks source link

BCGW Replication: FOM_CUTBLOCKS_SP - API timeouts #611

Closed MCatherine1994 closed 6 months ago

MCatherine1994 commented 6 months ago

Describe the Bug There was an error during the replication to the BCGW for FOM_CUTBLOCKS_SP: 'HTTP/1.1 504 Gateway Time-out'. So they call our api directly to connect with the BCGW, and that api returns a time out error. Investigate either increase the time out time, or increase the capacity.

Acceptance Criteria

Image

Additional context Found out the issue was caused by the Openshift default route timeout is 30s, somehow our PROD takes longer time to query compare with TEST, there will be a new ticket (#612) to investigate more. Basil did a quick fix through Openshift yaml, and we need this ticket to make the change in the Openshift config file.

Image

MCatherine1994 commented 6 months ago

Image

ianliuwk1019 commented 6 months ago

Interestingly, when looking into deployed (DEV) pod for performance of the "/bcgw-extract" execution, it returns fast in 3ms. (curl https://fom-13.apps.silver.devops.gov.bc.ca/api/spatial-feature/bcgw-extract?version=1.0-final -H "Accept: application/json") @basilv

{"level":"info","time": 2024-04-04T20:59:53.534Z,"pid":1,"hostname":"fom-13-api-1-dzbmw","req":{"id":3,"method":"GET","url":"/api/spatial-feature/bcgw-extract?version=1.0-final","query":{"version":"1.0-final"},"params":{"0":"spatial-feature/bcgw-extract"},"headers":{"user-agent":"curl/7.68.0","accept":"application/json","host":"fom-13.apps.silver.devops.gov.bc.ca","x-forwarded-host":"fom-13.apps.silver.devops.gov.bc.ca","x-forwarded-port":"443","x-forwarded-proto":"https","forwarded":"for=165.225.210.217;host=fom-13.apps.silver.devops.gov.bc.ca;proto=https","x-forwarded-for":"165.225.210.217"},"remoteAddress":"::ffff:10.97.28.1","remotePort":32762},"msg":"Start get /spatial-feature/bcgw-extract"}
{"level":"info","time": 2024-04-04T20:59:53.537Z,"pid":1,"hostname":"fom-13-api-1-dzbmw","req":{"id":3,"method":"GET","url":"/api/spatial-feature/bcgw-extract?version=1.0-final","query":{"version":"1.0-final"},"params":{"0":"spatial-feature/bcgw-extract"},"headers":{"user-agent":"curl/7.68.0","accept":"application/json","host":"fom-13.apps.silver.devops.gov.bc.ca","x-forwarded-host":"fom-13.apps.silver.devops.gov.bc.ca","x-forwarded-port":"443","x-forwarded-proto":"https","forwarded":"for=165.225.210.217;host=fom-13.apps.silver.devops.gov.bc.ca;proto=https","x-forwarded-for":"165.225.210.217"},"remoteAddress":"::ffff:10.97.28.1","remotePort":32762},"msg":"End get /spatial-feature/bcgw-extract for 3.1206917762756348ms."}
basilv commented 6 months ago

Hmm, that's unexpectedly fast. Is there all the test data (should be).

ianliuwk1019 commented 6 months ago

This is the spatial view for dev db:

Image

ianliuwk1019 commented 6 months ago

Fixed the missing "await" for function in PR#614. Now the bcgw function performance is correct: (Dev - for 18167 spatial feature rows) Image

ianliuwk1019 commented 6 months ago

Verified in Test environment: Image Takes: 14094.4197473526ms.

{"level":"info","time": 2024-04-05T17:08:28.244Z,"pid":1,"hostname":"fom-test-api-457-5298c","req":{"id":1,"method":"GET","url":"/api/spatial-feature/bcgw-extract?version=1.0-final","query":{"version":"1.0-final"},"params":{"0":"spatial-feature/bcgw-extract"},"headers":{"user-agent":"curl/7.68.0","accept":"application/json","host":"fom-test.nrs.gov.bc.ca","x-forwarded-host":"fom-test.nrs.gov.bc.ca","x-forwarded-port":"443","x-forwarded-proto":"https","forwarded":"for=165.225.210.217;host=fom-test.nrs.gov.bc.ca;proto=https","x-forwarded-for":"165.225.210.217"},"remoteAddress":"::ffff:10.97.28.1","remotePort":20966},"msg":"Start get /spatial-feature/bcgw-extract"}
{"level":"info","time": 2024-04-05T17:08:42.338Z,"pid":1,"hostname":"fom-test-api-457-5298c","req":{"id":1,"method":"GET","url":"/api/spatial-feature/bcgw-extract?version=1.0-final","query":{"version":"1.0-final"},"params":{"0":"spatial-feature/bcgw-extract"},"headers":{"user-agent":"curl/7.68.0","accept":"application/json","host":"fom-test.nrs.gov.bc.ca","x-forwarded-host":"fom-test.nrs.gov.bc.ca","x-forwarded-port":"443","x-forwarded-proto":"https","forwarded":"for=165.225.210.217;host=fom-test.nrs.gov.bc.ca;proto=https","x-forwarded-for":"165.225.210.217"},"remoteAddress":"::ffff:10.97.28.1","remotePort":20966},"msg":"End get /spatial-feature/bcgw-extract for 14094.4197473526ms."}
ianliuwk1019 commented 5 months ago

Released to production.