Commit a56d4f9
Reuse the epoll object to fix the dispatcher performance downgrade (#14800)
In commit e30909f, I used the "WaitEventSet" to refactor the related dispatch logic.
But in the following pgbench test, we found the performance downgrade 50% due to this commit. Did a perf on it, the bottleneck is native_queued_spin_lock_slowpath, means there is a lot of lock contention in it.
After investigation, we found the culprit is a large number of concurrent creation and destruction of epoll objects. Fix it in the commit: reuse the epoll object.And here are the pgbench results for reference:
```
./pgbench tpcb -j 200 -c 200 -n -P 1 -h mdw -p 5432 -U gpadmin -T 60 -S
// main
tps = 48662.387634 (including connections establishing)
tps = 48697.870330 (excluding connections establishing)
// revert e30909f
...
tps = 151641.552024 (including connections establishing)
tps = 151757.591140 (excluding connections establishing)
// main with this commit (fixed)
...
tps = 148574.817871 (including connections establishing)
tps = 148666.308622 (excluding connections establishing)
// 6x
...
tps = 114706.905303 (including connections establishing)
tps = 114795.896798 (excluding connections establishing)
```1 parent 61cdc19 commit a56d4f9
3 files changed
Lines changed: 132 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| 388 | + | |
| 389 | + | |
388 | 390 | | |
389 | 391 | | |
390 | 392 | | |
| |||
779 | 781 | | |
780 | 782 | | |
781 | 783 | | |
| 784 | + | |
| 785 | + | |
782 | 786 | | |
783 | 787 | | |
784 | 788 | | |
| |||
3820 | 3824 | | |
3821 | 3825 | | |
3822 | 3826 | | |
3823 | | - | |
3824 | 3827 | | |
3825 | 3828 | | |
3826 | 3829 | | |
3827 | 3830 | | |
3828 | | - | |
3829 | | - | |
3830 | | - | |
3831 | | - | |
3832 | 3831 | | |
3833 | 3832 | | |
3834 | 3833 | | |
| |||
3865 | 3864 | | |
3866 | 3865 | | |
3867 | 3866 | | |
3868 | | - | |
3869 | | - | |
3870 | | - | |
3871 | | - | |
3872 | | - | |
| 3867 | + | |
| 3868 | + | |
| 3869 | + | |
| 3870 | + | |
| 3871 | + | |
| 3872 | + | |
| 3873 | + | |
| 3874 | + | |
| 3875 | + | |
| 3876 | + | |
| 3877 | + | |
| 3878 | + | |
| 3879 | + | |
| 3880 | + | |
| 3881 | + | |
3873 | 3882 | | |
3874 | | - | |
| 3883 | + | |
| 3884 | + | |
| 3885 | + | |
3875 | 3886 | | |
3876 | | - | |
| 3887 | + | |
| 3888 | + | |
| 3889 | + | |
3877 | 3890 | | |
| 3891 | + | |
| 3892 | + | |
| 3893 | + | |
| 3894 | + | |
| 3895 | + | |
| 3896 | + | |
| 3897 | + | |
| 3898 | + | |
| 3899 | + | |
| 3900 | + | |
| 3901 | + | |
| 3902 | + | |
| 3903 | + | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
3878 | 3909 | | |
| 3910 | + | |
| 3911 | + | |
| 3912 | + | |
| 3913 | + | |
3879 | 3914 | | |
3880 | 3915 | | |
3881 | 3916 | | |
| |||
3905 | 3940 | | |
3906 | 3941 | | |
3907 | 3942 | | |
3908 | | - | |
3909 | | - | |
3910 | | - | |
3911 | | - | |
3912 | | - | |
3913 | | - | |
3914 | | - | |
| 3943 | + | |
3915 | 3944 | | |
3916 | 3945 | | |
3917 | 3946 | | |
| |||
3963 | 3992 | | |
3964 | 3993 | | |
3965 | 3994 | | |
3966 | | - | |
| 3995 | + | |
3967 | 3996 | | |
3968 | 3997 | | |
3969 | 3998 | | |
| |||
3978 | 4007 | | |
3979 | 4008 | | |
3980 | 4009 | | |
3981 | | - | |
3982 | | - | |
3983 | | - | |
3984 | | - | |
3985 | | - | |
3986 | | - | |
3987 | | - | |
3988 | | - | |
| 4010 | + | |
3989 | 4011 | | |
3990 | 4012 | | |
3991 | 4013 | | |
3992 | 4014 | | |
3993 | 4015 | | |
| 4016 | + | |
3994 | 4017 | | |
3995 | 4018 | | |
3996 | 4019 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
785 | 785 | | |
786 | 786 | | |
787 | 787 | | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
788 | 866 | | |
789 | 867 | | |
790 | 868 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
183 | 186 | | |
184 | 187 | | |
0 commit comments