event write performance is terrible in sql backend
Bug #1381736 reported by
gordon chung
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ceilometer |
Fix Released
|
Medium
|
gordon chung |
Bug Description
when generating a generic list of events, the write performance is terrible for the sql backend compared to mongodb.
ie. ~4700 events, a single thread, a single event type, each event has 4 different traits of different types:
completion time (mongodb): ~2.17s
completion time(mysql/
so... yeah.
Changed in ceilometer: | |
status: | Triaged → In Progress |
Changed in ceilometer: | |
milestone: | none → kilo-3 |
Changed in ceilometer: | |
status: | Fix Committed → Fix Released |
Changed in ceilometer: | |
milestone: | kilo-3 → 2015.1.0 |
To post a comment you must log in.
current schema:
- EventType
message_ id: message id
generated = timestamp of event
event_type_ id = event type -> eventtype.id
trait_type_ id: trait type -> traittype.id
t_string: string value
t_float: float value
t_int: integer value
t_datetime: timestamp value
data_type: data type (integer that maps to datatype)
- event definition
- { id: event type id
desc: description of event
}
- Event
- event data
- { id: event id
}
- Trait
- trait value
- { event_id: event -> event.id
}
- TraitType
- trait definition
- { id: trait id
desc: description of trait
}
step 1 proposal:
divide trait table into 4 tables, one for each trait_type -- similar to how we handle metadata in metering data. in current design we're always guaranteed that 3 of 6 columns are always empty in each row. this adds unnecessary complexity as we have to store more data (empty data), and then during retrieval, we again have overhead to figure out which column the value is stored in.
the Trait TraitType table will be dropped in proposal and replaced with 4 Trait_* tables (one for each possible trait type).
ie.
- Trait_String
value: string value
value: float value
value: int value
value: string value
- trait value
- { event_id: event -> event.id
key: trait type -> traittype.id
}
- Trait_float
- trait value
- { event_id: event -> event.id
key: trait type -> traittype.id
}
- Trait_int
- trait value
- { event_id: event -> event.id
key: trait type -> traittype.id
}
- Trait_datetime
- trait value
- { event_id: event -> event.id
key: trait type -> traittype.id
}