Getting timeouts when trying "cf service-access" commands
Command
cf disable-service-access
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
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.
@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?
we have similar issue .. there should be faster specific options for doing this from cf cli
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 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.
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/118894653disable-service-access: https://www.pivotaltracker.com/n/projects/892938/stories/119236239service-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.
@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?
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
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.
@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 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
@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.
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.
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!