Echo makes too many round-trips to memcached
Closed, ResolvedPublic

Description

When I load [[en:Main_page]] and watch memcached GETs using tcpdump, I see Echo making five round-trips to memcached on every page view:

enwiki:echo-notification-count-message:...:1.5
enwiki:echo-notification-count-alert:...:1.5
enwiki:echo-notification-timestamp-message:...:1.5
enwiki:echo-notification-timestamp-alert:...:1.5
enwiki:echo:user:had:messages:...:1.5

It'd be better if these were consolidated into a single getMulti() call. It'd be better still if these values were stored under a single key. And it'd be best of all if they were stored in the session data that is already getting retrieved on every page view.

ori created this task.Feb 22 2016, 8:28 AM
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptFeb 22 2016, 8:28 AM
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald Transcript

Re had:messages: I'm proposing we get rid of the code that uses that key, see T127731: Don't hide messages badge when user has never had messages.

As for the others, I agree a single key would be better. Could you elaborate on what you mean by the session data thing? I'm not familiar with that.

As for the others, I agree a single key would be better. Could you elaborate on what you mean by the session data thing? I'm not familiar with that.

@ori ?

Change 279382 had a related patch set uploaded (by Matthias Mullie):
Bundle memcached requests

https://gerrit.wikimedia.org/r/279382

Change 279382 merged by jenkins-bot:
Bundle memcached requests

https://gerrit.wikimedia.org/r/279382

ori closed this task as Resolved.Apr 22 2016, 12:07 AM

As for the others, I agree a single key would be better. Could you elaborate on what you mean by the session data thing? I'm not familiar with that.

@ori ?

I meant you could store it in the user session (RequestContext::getMain()->getRequest()->getSession()->set( .. ), etc.). But on reflection that is not feasible here. The getMulti() by @matthiasmullie solves this as a performance issue, from my perspective.