cli icon indicating copy to clipboard operation
cli copied to clipboard

Getting timeouts when trying "cf service-access" commands

Open svennela opened this issue 10 years ago • 14 comments

Command

cf disable-service-access -o Disabling access to all plans of service logstash-6 for the org [email protected] as admin...

CLI Version

Error

Error performing request: Get https://api.system.<end_point>/v2/service_plan_visibilities?order-direction=asc&page=244&results-per-page=50: dial tcp: lookup api.system.<end_point>: no such host When I run the exact same command from the jumphost, it has taken 20mins and finally succeeded.

Customer has 7000 orgs.

In prod environment. cf service-access cf enable-service-access cf disable-service-access All the 3 commands take like unto an hour to respond and sometimes timeout.

Stack Trace

Platform Details

e.g. Mac OS X 10.11, Windows 8.1 64-bit, Ubuntu 14.04.3 64-bit

Shell

e.g. Terminal, iTerm, Powershell, Cygwin, gnome-terminal, terminator

svennela avatar Apr 16 '16 16:04 svennela

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/117756073.

cf-gitbot avatar Apr 16 '16 16:04 cf-gitbot

@SocalNick: I read on slack that this command is known to take an extremely long time due to the number of requests it needs to make (number of service brokers X services per broker X plans per broker X orgs that use said plan). Can you provide us an API that would reduce the number of calls the CLI needs to make?

dkoper avatar Apr 21 '16 21:04 dkoper

we have similar issue .. there should be faster specific options for doing this from cf cli

amulyas avatar Apr 22 '16 17:04 amulyas

Looking at what we do prior to the enable/disable service request, for whatever reason we are getting a full suite of information about every service X plan available to this organization. This seems extremely unnecessary and heavy weight for what these commands are trying to do.

I think if we re-evaluate how these commands are setup, we may be able to make it faster (eg, not make the n*m number of requests).

The service-access command however will still require the previously quoted "service brokers X services per broker X plans per broker X orgs that use said plan" number of requests. So that will still unfortunately take a long time to return.

XenoPhex avatar Apr 25 '16 19:04 XenoPhex

@XenoPhex thanks for looking into ways to improve the enable / disable calls. These commands seem like candidates for API endpoints that take the service_guid, plan_guid (optional), and org_guid (optional). Feel free to drop a story.

I don't know how we could improve service-access for deployments with 7000 organizations. I would start by considering whether or not this command provides any useful information at this scale. I would consider not displaying organization information when there are more than X orgs and requiring the command to be bound by a particular broker, service, or org.

Experimenting on A1, I've yet to get the service-access command to return when trying to filter by org.

SocalNick avatar Apr 26 '16 20:04 SocalNick

The issue description lists 3 commands, each supporting multiple arguments affecting the API calls made. We'll explore the 3 commands separately as follows:

  • enable-service-access: https://www.pivotaltracker.com/n/projects/892938/stories/118894653
  • disable-service-access: https://www.pivotaltracker.com/n/projects/892938/stories/119236239
  • service-access: https://www.pivotaltracker.com/n/projects/892938/stories/117756073

When those investigations are complete, let's revisit and see if and what further work would be required for combinations of specific arguments to these commands.

dkoper avatar May 13 '16 03:05 dkoper

@svennela We have just pushed an improvement to the commands and are curious to see how they fare on your cloud foundry. Can you please try the corresponding CF CLI binary below and give us feedback?

Linux-64

Windows-64

OSX-64

jeffpak avatar May 13 '16 17:05 jeffpak

We have improved the performance of enable-service-access and disable-service-access. Please try with cf CLI 6.19.0, released today. https://github.com/cloudfoundry/cli#downloads

The service-access performance is in the backlog to be investigated hopefully soon.

Regards, Dies Koper CF CLI PM

dkoper avatar Jun 09 '16 01:06 dkoper

Once you have too many Orgs cf service access will not work there are few things you can do

Try limiting scope by cf service access -b

If you wanted to add service access then I can send you cf api to do so

Sent from my iPhone

On Jun 8, 2016, at 6:28 PM, Dies Koper [email protected] wrote:

We have improved the performance of enable-service-access and disable-service-access. Please try with cf CLI 6.19.0, released today. https://github.com/cloudfoundry/cli#downloads

The service-access performance is in the backlog to be investigated hopefully soon.

Regards, Dies Koper CF CLI PM

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

amulyas avatar Jun 09 '16 01:06 amulyas

@dkoper @amulyas We recently faced a lot of issues while running 'cf service-access' on one of our environments. The turnaround time for the command execution is >5mins. The other recommendation that 'cf service-access -b SERVICE_BROKER_NAME' reduces the turnaround time is also wrong. As the time taken for execution of this command is exactly the same as the former one. It probably just gets the same result for both the commands and simply filters the output as per the flag.

Can you please comment when this issue will be fixed for CF or at-least the 'cf service-access -b' will have a better performance than 'cf service-access'? Alternatively, is there any other way to get the results as returned by the cli command, which has a better turnaround time? May be some sort of api?

pritishmishra avatar Aug 21 '17 10:08 pritishmishra

@pritishmishra only way I was able to get the information of cf service-access -b is by query the database directly there is no API as relationships are maintained separately and presented only after union of everything

amulyas avatar Aug 22 '17 08:08 amulyas

@pritishmishra We still have so many stories to go through until we get to this one. That said, initial explorations (see comments above) indicated that there currently are no APIs to make this faster. Once we get to this story, I hope we'll have a better idea what APIs to request CAPI for.

dkoper avatar Oct 30 '17 01:10 dkoper

Hi @svennela thanks for creating this issue. I'm circling back to see if this command is working for you now; it looks like there was an improvement to the command that was made after your initial comments. We still plan on rewriting this command but I'm reaching out to see if there's been improvement on your side. Thanks.

abbyachau avatar May 04 '18 22:05 abbyachau

Hey @svennela Hopefully this issue was resolved a few months ago and so I'm going to close this issue. Please feel free to reopen it if you encounter this again!

mattmcneeney avatar Dec 13 '18 00:12 mattmcneeney