Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 499522

Summary: [server] user cache by login / userId is not needed and is a performance issue
Product: [ECD] Orion Reporter: Anthony Hunter <ahunter.eclipse>
Component: ServerAssignee: Anthony Hunter <ahunter.eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 13.0   
Target Milestone: 13.0   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Anthony Hunter CLA 2016-08-10 14:54:07 EDT
We have known that the user cache and startup has been an issue for some time. John added a fix in Bug 482169 that seemed to help things, but this fix is no longer working.

The user cache is for fast lookups of oauth, email and userId to login. This is a holdover from the old CompatibilityMetaStore used back in Orion 3.0. The oauth and email make sense for Orion. You are given an email and need to do a fast in memory lookup of the login userId without having to search the entire disk. Since the disk is already keyed by userId however, it seems logical that we do not need to maintain a userId cache in memory anymore, just go to disk.

As a result of the current userId cache, you cannot login until this cache is built, even though the server is up and running.

We have a large installation where the cache takes six minutes to build, meaning you cannot login for six minutes. If we removed the userId cache and did a disk lookup immediately, you could login once the server is up.

I am going to remove the cache by userId, leaving email and oauth.
Comment 1 Anthony Hunter CLA 2016-08-10 16:01:15 EDT
I am able to take advantage of the Orion SimpleServerUserStressTest to create one million users in an Orion instance. With my changes, I can verify that I can login and successfully use Orion with a simple userId and password before the cache has been built for email and oauth.

The orion.log looks like:
[2016-08-10 19:19:05.413 Z] [Worker-0] INFO  org.eclipse.orion.server.config - Loaded simple metadata store (version 8).
[2016-08-10 19:19:14.081 Z] [qtp1979586334-55] INFO  org.eclipse.orion.server.login - Login success: ahunter
[2016-08-10 19:34:01.195 Z] [Worker-0] INFO  org.eclipse.orion.server.config - Finished processing 1000003 users for registerUserProperties, duration: 895781ms
[2016-08-10 19:34:01.195 Z] [Worker-0] INFO  org.eclipse.orion.server.config - Started Orion server authentication successfully.

The email and oauth cache takes about fifteen minutes to build for one million users on my machine, so you still need to wait as much as fifteen minutes to login with your email address.

Since my particular performance issue is related to login by userId, I am marking this resolved.

This is fixed with commit:
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=61bb4c2be29b74182a43f90e9d7b3f15352772fe