Netflix / Prana

A sidecar for your NetflixOSS based services.
Apache License 2.0
502 stars 98 forks source link

Prana ribbon configuration in documentation? #15

Open victuxbb opened 8 years ago

victuxbb commented 8 years ago

Hi, I think it would be useful that make some documentation about how to change the default configuration of ribbon. In ProxyHandler I have found the prefix to modify ribbon config client but nobody mentions it on documentation:

private LoadBalancingHttpClient<ByteBuf, ByteBuf> getClient(String vip) {
        LoadBalancingHttpClient<ByteBuf, ByteBuf> client = httpClients.get(vip);
        if (client == null) {
            IClientConfig config = IClientConfig.Builder.newBuilder("prana_backend").
                    withDefaultValues().
                    withDeploymentContextBasedVipAddresses(vip).
                    build().
                    set(IClientConfigKey.Keys.MaxTotalConnections, 2000).
                    set(IClientConfigKey.Keys.MaxConnectionsPerHost, 2000).
                    set(IClientConfigKey.Keys.OkToRetryOnAllOperations, false).
                    set(IClientConfigKey.Keys.NIWSServerListClassName, DiscoveryEnabledNIWSServerList.class.getName());

            client = RibbonTransport.newHttpClient(new HttpClientPipelineConfigurator<ByteBuf, ByteBuf>(), config);
            httpClients.putIfAbsent(vip, client);

        }
        return client;
    }

As I understand if I want to change something I will need to create properties like this:

prana_backend.ribbon.IsSecure=false
prana_backend.ribbon.ReadTimeout=3000
prana_backend.ribbon.ConnectTimeout=3000
prana_backend.ribbon.MaxAutoRetries=1
prana_backend.ribbon.OkToRetryOnAllOperations=true
prana_backend.ribbon.MaxAutoRetriesNextServer=1
prana_backend.ribbon.FollowRedirects=false
prana_backend.ribbon.ConnIdleEvictTimeMilliSeconds=3600001
prana_backend.ribbon.ServerListRefreshInterval=60001

Thanks!

aspyker commented 8 years ago

@victuxbb Thank you for the contribution. More will be coming, but please see http://ispyker.blogspot.com/2015/10/towards-being-better-about-open-source.html for a bit of context on the status of this project.