Closed
Bug 1100903
Opened 11 years ago
Closed 11 years ago
Batch redis commands wherever possible
Categories
(Hello (Loop) :: Server, defect, P1)
Hello (Loop)
Server
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: mikedeboer, Assigned: rhubscher)
References
Details
(Whiteboard: [loop-server 0.15.0])
Attachments
(1 file)
There are quite a couple of places in loop/storage/redis.js that can benefit from using the Redis MULTI command to batch calls:
`deleteUserCallUrls`, `deleteUserCalls`, `getUserCalls`, `incrementConnectedCallDevices`, `decrementConnectedCallDevices`, `getCall`, `touchHawkSession`, `setUserRoomData`, `getUserRooms`, `touchRoomParticipant`, `deleteRoomParticipant`.
I know that certain functions use async.map to call into other member functions that do some processing, but one way to migrate from that is to have these functions optionally return commands instead of executing them. These commands can then be concatenated and passed to _client.multi().
This will dramatically improve performance, I think, by lowering the overhead of socket traffic and more efficient redis task scheduling.
| Assignee | ||
Comment 1•11 years ago
|
||
Good point, thanks.
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → rhubscher
| Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8542160 -
Flags: review?(alexis+bugs)
| Assignee | ||
Updated•11 years ago
|
Attachment #8542160 -
Flags: feedback?(mdeboer)
| Assignee | ||
Comment 3•11 years ago
|
||
Apparently I still need to work on:
- getUserCalls
- getCall
mikedeboer — getUserRooms seems clean to me, where could we use multi?
| Reporter | ||
Comment 4•11 years ago
|
||
(In reply to Rémy Hubscher (:natim) from comment #3)
> mikedeboer — getUserRooms seems clean to me, where could we use multi?
`getUserRooms` also looks good to, please scratch it from the list ;)
| Assignee | ||
Comment 5•11 years ago
|
||
Do you see anything we could benefit from?
| Reporter | ||
Comment 6•11 years ago
|
||
Comment on attachment 8542160 [details] [review]
Link to Github PR — #267.
Awesome! I foresee much win having this in, thanks!
Attachment #8542160 -
Flags: feedback?(mdeboer) → feedback+
Comment 7•11 years ago
|
||
Comment on attachment 8542160 [details] [review]
Link to Github PR — #267.
This just landed with https://github.com/mozilla-services/loop-server/commit/25d4029cbef215af1bfcb1192d395880975a9f5c, awesome :)
Attachment #8542160 -
Flags: review?(alexis+bugs) → review+
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [loop-server 0.15.0]
You need to log in
before you can comment on or make changes to this bug.
Description
•