mirror of
https://github.com/cloudflare/pingora.git
synced 2024-09-20 02:31:35 +02:00
8160ad1698
Co-authored-by: =?~~~?q?Ren=C3=A9=20Kla=C4=8Dan?= <rene@klacan.sk> Co-authored-by: 12932 <68835423+12932@users.noreply.github.com> Co-authored-by: Alessandro <aleferrara1998@gmail.com> Co-authored-by: InImpasse <40639475+InImpasse@users.noreply.github.com> Co-authored-by: Paul James Cleary <pauljamescleary@gmail.com> Co-authored-by: Yang Hau <yuanyanghau@gmail.com> Co-authored-by: Morpheus <40785143+Muzych@users.noreply.github.com> Co-authored-by: mobeicanyue <81098819+mobeicanyue@users.noreply.github.com> Co-authored-by: Twacqwq <69360546+Twacqwq@users.noreply.github.com> Co-authored-by: Bobby <zkd8907@live.com> Co-authored-by: Dup4 <lyuzhi.pan@gmail.com> Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Co-authored-by: Sheldon <1415182877@qq.com> Co-authored-by: houseme <housemecn@gmail.com> Co-authored-by: ZhangIvan1 <zhang_ivan1@163.com> Co-authored-by: GrahamQuan <33834833+GrahamQuan@users.noreply.github.com> Co-authored-by: =?~~~?q?Cristian=20Paul=20Pe=C3=B1aranda=20Rojas?= <paul@kristianpaul.org> Co-authored-by: Nathan Sit <nsit.earth@gmail.com> Co-authored-by: David Lee <67067729+LordMoMA@users.noreply.github.com> Co-authored-by: Mengliang Su <mengliang.su@shopee.com> Co-authored-by: =?~~~?q?=EA=B9=80=EC=84=A0=EC=9A=B0?= <seonwoo960000@toss.im> Co-authored-by: Allen Huang <huangseji@meituan.com> Co-authored-by: Opacity <70315161+zreren@users.noreply.github.com> Co-authored-by: cris <sqdcmk@gmail.com> Co-authored-by: Killian Ye <40255385+ykw1129@users.noreply.github.com> Co-authored-by: Jiwei-dev <hi.jiwei@gmail.com> Co-authored-by: Jinfeng Wang <41931794+wjf40390@users.noreply.github.com> Co-authored-by: Ikko Eltociear Ashimine <eltociear@gmail.com>
19 lines
1.3 KiB
Markdown
19 lines
1.3 KiB
Markdown
# Graceful restart and shutdown
|
|
|
|
Graceful restart, upgrade, and shutdown mechanisms are very commonly used to avoid errors or downtime when releasing new versions of Pingora servers.
|
|
|
|
Pingora graceful upgrade mechanism guarantees the following:
|
|
* A request is guaranteed to be handled either by the old server instance or the new one. No request will see connection refused when trying to connect to the server endpoints.
|
|
* A request that can finish within the grace period is guaranteed not to be terminated.
|
|
|
|
## How to graceful upgrade
|
|
### Step 0
|
|
Configure the upgrade socket. The old and new server need to agree on the same path to this socket. See configuration manual for details.
|
|
|
|
### Step 1
|
|
Start the new instance with the `--upgrade` CLI option. The new instance will not try to listen to the service endpoint right away. It will try to acquire the listening socket from the old instance instead.
|
|
|
|
### Step 2
|
|
Send SIGQUIT signal to the old instance. The old instance will start to transfer the listening socket to the new instance.
|
|
|
|
Once step 2 is successful, the new instance will start to handle new incoming connections right away. Meanwhile, the old instance will enter its graceful shutdown mode. It waits a short period of time (to give the new instance time to initialize and prepare to handle traffic), after which it will not accept any new connections.
|