Closed Bug 993926 Opened 10 years ago Closed 10 years ago

Bugzilla::User::Setting::get_all_settings() should use memcached

Categories

(Bugzilla :: Bugzilla-General, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
Bugzilla 5.0

People

(Reporter: glob, Assigned: glob)

Details

(Keywords: bmo-goal, perf)

Attachments

(1 file)

due to the gravatar extension on BMO, $user->settings() is called for each commenter.  this results in frequent database calls for data that changes very infrequently, making it an ideal candidate for memcached.

changes required:
- during an update in editsettings.cgi call Bugzilla->memcached->clear_config()
- update Bugzilla::User::Settings:
  - update get_all_settings($user_id)
    - build a cache key as "user_settings.$user_id"
    - check the cache with Bugzilla->memcached->get_config($key) and return if found
    - if not found, query the database and store with memcached->set_config()
  - add a method clear_settings_cache($user_id)
    - calls memcached->clear({ key => $key }) using the same key as get_all_settings()
- call clear_settings_cache() from userprefs.cgi::SaveSettings()

i'm not totally comfortable with clear_settings_cache(), however the way settings have been implemented makes abstraction difficult (the settings hashref inside the user object is updated directly by userprefs.cgi, and using a tied hashref would be an overkill).
Severity: normal → enhancement
Keywords: bmo-goal
Assignee: general → glob
Attached patch 993926_1.patchSplinter Review
Attachment #8444484 - Flags: review?(sgreen)
Priority: -- → P1
Attachment #8444484 - Flags: review?(sgreen) → review+
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   8b98912..c19dc4f  master -> master
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: approval+
Resolution: --- → FIXED
Target Milestone: --- → Bugzilla 5.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: