Closed mkasztelnik closed 7 years ago
FYI This might be related to a large amount of new threatassessmentruns, threatassessments and results, which appeared yesterday.
I'm aware about this drop, but the main problem here is connected with n+1 queries and most probably with bug in number of returned treat_level_assesment_runs
.
OK, I just wanted to give all involved a 'heads up' ;)
@tbartynski This is your code - perhaps you want to pick up this ball? (If not, I can take care of it but am extremely busy with another project right now and will not have time before Thursday...)
I'll try to fix it.
I improved it a little bit last Wednesday and since then it takes about 2 seconds. I will continue work on this issue.
Improved a little more. time curl https://dap-dev.moc.ismop.edu.pl/api/v1/threat_levels?private_token=XXX => real 0m1.276s user 0m0.017s sys 0m0.004s
Further improvements were made: time curl https://dap-dev.moc.ismop.edu.pl/api/v1/threat_levels?private_token=XXX => real 0m0.432s user 0m0.003s sys 0m0.008s
server side log: Completed 200 OK in 387ms (Views: 3.5ms | ActiveRecord: 54.6ms)
I guess it's good enough.
Good for now
Test case:
result:
There is a lot of n+1 queries in DAP logs and additional bug connected with returning a loooong list of
threat_level_assessment_runs
elements.