Status

Socorro
General
RESOLVED FIXED
10 years ago
6 years ago

People

(Reporter: ted, Assigned: ted)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

10 years ago
Why is the status page so slow? It's doing two queries, one or both of them must suck. I would guess it's the reports query, since that table is much bigger.
(Assignee)

Comment 1

10 years ago
select([reports.c.date_processed],
       order_by=sql.desc(reports.c.date_processed),
       limit=1

is the reports query.

select([func.count(jobs.c.id)],
        jobs.c.completeddatetime == None

is the jobs query. is that reports query screwing us by not having a date limit? I would think 'limit 1' would be good.

(Assignee)

Comment 2

10 years ago
explain select date_processed from reports order by date_processed desc limit 1;

 Limit  (cost=2655.91..2655.91 rows=1 width=8)
   ->  Sort  (cost=2655.91..2667.54 rows=4652 width=8)
         Sort Key: public.reports.date_processed
         ->  Result  (cost=0.00..2372.52 rows=4652 width=8)
               ->  Append  (cost=0.00..2372.52 rows=4652 width=8)
                     ->  Seq Scan on reports  (cost=0.00..10.20 rows=20 width=8)
                     ->  Seq Scan on reports_part1 reports  (cost=0.00..2362.32 rows=4632 width=8)


Yeah, that's bad. We don't have an index on date_procesed. Can we just get this from the jobs table instead? Or store it somewhere else?
(Assignee)

Comment 3

10 years ago
Created attachment 314843 [details] [diff] [review]
use jobs instead

This is approximately a million billion times better. Ok, it's still doing a seq scan on jobs, but that table is much smaller than reports. We could toss an index on here to make it better, but that's of questionable merit. Adding an index to reports to fix this problem just seems silly.
Assignee: nobody → ted.mielczarek
Status: NEW → ASSIGNED
Attachment #314843 - Flags: review?(morgamic)
Comment on attachment 314843 [details] [diff] [review]
use jobs instead

Could we add # of items in the queue, # of threads and oldest item in queue?
Attachment #314843 - Flags: review?(morgamic) → review+
(Assignee)

Comment 5

10 years ago
# items in queue is already on that page. I'll make it grab the other info.
(Assignee)

Comment 6

10 years ago
Created attachment 314915 [details] [diff] [review]
with more stuffs

Yeah, I didn't add # of processors because we don't have that table defined yet in the SQLAlchemy model, and I just don't feel like adding it. This adds OldestQueuedJob, AverageProcessTime (process end time - process start time), and AverageWaitTime (process end time - queue time).
Attachment #314843 - Attachment is obsolete: true
(Assignee)

Updated

10 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Component: Socorro → General
Product: Webtools → Socorro
You need to log in before you can comment on or make changes to this bug.