-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenCloud Lazy Connection? #72
Comments
Is there some news about this issue ? It throws Sf2 initialization time from 30ms to 750ms. Thanks |
@ZeBigDuck This issue has been fixed on the Gaufrette level. See here: https://github.com/KnpLabs/Gaufrette#lazyopencloud Let me know if this doesn't work for you. |
Hi Richtermeister, thank you for your answer, In fact, I'm not that I'm using the opencloud adapter. Here's my configuration : knp_gaufrette:
adapters:
default:
opencloud:
object_store_id: opencloud.object_store
container_name: default
filesystems:
default:
adapter: default
stream_wrapper:
protocol: data
services:
opencloud.connection:
class: OpenCloud\OpenStack
arguments:
- %openstack_identity_url%
- {username: %openstack_username%, password: %openstack_password%, tenantName: %openstack_tenant_name%}
opencloud.object_store:
class: OpenCloud\ObjectStore\Service
factory_service: opencloud.connection
factory_method: objectStoreService
arguments:
- 'swift' # Object storage type
- 'RegionOne' # Object storage region
- 'publicURL' # url type I'm using openStack, which is in php-opencloud repository. I don't know if I can replace openStack by openCloud... |
Hey @ZeBigDuck. Are you using this with Rackspace? I can look at this tonight, if you're not in a rush.. |
Oh sorry for latency of my answer, I'm using it with OVH PCS (https://www.ovh.com/fr/cloud/stockage/). I think it works the same way that rackspace does. This would be awesome if you could do something with this. I'm not sure to understand these libs enough to do it myself. Thank you very much for your consideration, take your time anyway! |
Any news on using the lazy connection? |
Not on my end. I've actually resorted to just flagging filesystem services as lazyload in the Symfony container. |
I have the same problem. Did you fix it? |
@ybert No, this issue is not fixed, but the workaround is simple. Just flag the filesystem service as lazy. |
I think it's easy but I have no idea where I put this flag? Can you show me where to put this flag in the config? Thank you for your time. |
Ok I found the trick. services: opencloud.connection: class: OpenCloud\OpenStack arguments: - %openstack_identity_url% - {username: %openstack_username%, password: %openstack_password%, tenantId: %openstack_tenant_id%} opencloud.object_store: lazy: true class: OpenCloud\ObjectStore\Service factory: ["@opencloud.connection", objectStoreService] arguments: - %openstack_object_storage_type% - %openstack_object_storage_region% - %openstack_object_storage_url% Thank you it fixed it perfectly |
As already noted, the best is to define opencloud objects as lazy-loaded services so they won't initialize any external connection every time the container is used. We'll remove LazyOpenCloud from the next major release and it is already deprecated for current minor version (see here and here). As such it'll not be implemented in the bundle. For concerns about using OpenCloud adapter with OVH, there's already an issue. But I don't if it works currently. |
Hi all,
Gaufrette has recently added lazy-loading OpenCloud connections (KnpLabs/Gaufrette@5084853). Is this feature currently supported in this bundle? I can't seem to find this in the documentation.. If not, I may be able to contribute this (assuming I can model it off the lazyloading Rackspace connection that already exists here).
Thanks!
The text was updated successfully, but these errors were encountered: