tencent cloud

Feedback

Service Timeout Configuration

Last updated: 2023-12-26 10:45:52

    Overview

    The order service has a timeout period of three seconds as shown below:
    
    
    After fault injection is configured for the stock service, it is found that user requests to the website will be in the waiting status due to the fault. To optimize the browsing experience, a timeout period needs to be configured.

    Directions

    Configure a timeout period of three seconds for the order service by applying the following VirtualService and no timeout period for the cart service.
    apiVersion: networking.istio.io/v1alpha3
    kind: VirtualService
    metadata:
    name: order-vs
    namespace: base
    spec:
    hosts:
    - order.base.svc.cluster.local
    http:
    - match:
    - headers:
    cookie:
    exact: vip=false
    route:
    - destination:
    host: order.base.svc.cluster.local
    subset: v1
    timeout: 3000ms
    - match:
    - headers:
    cookie:
    exact: vip=true
    route:
    - destination:
    host: order.base.svc.cluster.local
    subset: v2
    timeout: 3000ms
    After the configuration, add an item to the cart, and the cart service will experience an access latency of seven seconds due to the injected fault, without a timeout. Then, click CHECKOUT to start the checkout process and call the order service, and, in addition to the access latency of seven seconds, the order service will experience a timeout period of three seconds, which means a timeout will occur if no operation is performed within three seconds after the order service is called. The timeout occurring when the cart service calls the order service is as shown below:
    
    
    After completing the timeout configuration and the fault injection test on the service, delete the VirtualService resource associated with the stock service to disassociate the configured fault injection policy from the stock service.
    Delete the VirtualService associated with the stock service as shown below:
    
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support