flomesh-io / fsm-classic

FSM(Flomesh Service Mesh ) is Kubernetes North-South traffic manager, provides Ingress controllers, Gateway API, Load Balancer, and cross-cluster service registration and service discovery. FSM uses Pipy(https://github.com/flomesh-io/pipy) as data plane and suitable for cloud, edge and IoT.
MIT License
42 stars 4 forks source link

[Question] About run pipy on the same pod of ingress controller #241

Open liangyuanpeng opened 1 year ago

liangyuanpeng commented 1 year ago

Please describe what should be documented

Is it mean one pipy ingress controller only working for one pipy service?

And what's the motivation for this design? Why not two pod or tow containers of one pod for this?

https://github.com/flomesh-io/fsm/blob/f5500f07b889a9f8168baa42ade08535f676ef97/cmd/ingress-pipy/main.go#L188-L195

Please suggest where in the repo the document should be located

Some design at README for ingress controller and pipy.

reaver-flomesh commented 1 year ago

PIPY was single thread, we need to leverage OS capabilities to run multiple PIPY instances with port reuse and let OS to distribute requests among those instances. Thus when it configures more than ONE core CPU resource for the ingress POD, more PIPY instances are started according to the CPU limits to gain better performance and throughput.

As of PIPY 0.90.0, it supports multi-threads natively, so it runs ONE pipy instance with multiple threads --threads=%d. Two ingress pods doesn't resolve the problem if more cores are configured. If running two containers in one pod, it cannot listen on same port, making it more complicated for the PIPY scripts and config JSON.