Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1613075 - Significant delay when switching projects
Significant delay when switching projects
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.6.0
Unspecified Unspecified
medium Severity medium
: ---
: 3.11.0
Assigned To: Juan Vallejo
Xingxing Xia
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2018-08-06 19:52 EDT by Luke Stanton
Modified: 2018-10-11 03:24 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-10-11 03:24:00 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2652 None None None 2018-10-11 03:24 EDT

  None (edit)
Description Luke Stanton 2018-08-06 19:52:30 EDT
Description of problem:
Project switching is very slow when a large kube config file is being used to track context.

How reproducible:
Consistently.

Steps to Reproduce:
1. Run the 'oc project' command on a machine tracking a large number of contexts in the kube config file

Actual results:
A significant amount of time is required to switch projects.

Expected results:
The project change should happen in a reasonably short amount of time.

Additional info:

Here's an example of the time discrepancy...

--------------------------------------
time oc project op-platform-kit-ci
Now using project "op-platform-kit-ci" on server "https://vh-*****io:8443".

real    0m19.215s
user    0m21.837s
sys     0m0.465s

Compared with:
time oc project op-platform-auth-service
Now using project "op-platform-auth-service" on server "https://vh-*****.io:8443".

real    0m2.242s
user    0m2.521s
sys     0m0.121s
--------------------------------------
Comment 2 Juan Vallejo 2018-08-07 15:02:24 EDT
The reason why this happens, is because we are modifying your kubeconfig any time you switch to a new project [1] in order to update context information. When we do this, we are reading [2] and writing [3] to and from the config file once for _every_ context that you have. This in turn, causes an increasing delay for every context present in your config.

Origin PR: https://github.com/openshift/origin/pull/20566/files

1. https://github.com/openshift/origin/blob/master/pkg/oc/cli/project/project.go#L268

2. https://github.com/kubernetes/client-go/blob/master/tools/clientcmd/config.go#L231

3. https://github.com/kubernetes/client-go/blob/master/tools/clientcmd/config.go#L237
Comment 3 Juan Vallejo 2018-08-14 18:10:02 EDT
Origin PR has merged. Moving to MODIFIED
Comment 5 Xingxing Xia 2018-08-23 23:31:00 EDT
We met this issue in which case the config size is 321K. Verifying with v3.11.0-0.20.0, the issue disappears.
Comment 7 errata-xmlrpc 2018-10-11 03:24:00 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:2652

Note You need to log in before you can comment on or make changes to this bug.