Test was done on VM with 4X CPU E5-2660 2.20GHz + 4GB mem with tools written by pgbench-tools on postgresql 9.4.5
settings: run test 3 times by 10 min, db size 100(1.5gb) 400(6gb) 700 (10gb) 1000 (15gb), clients 1,2,4,8,16,32
Results: with the exception of an anomalous drawdown in the last test, without selinux performance gain can reaches 20%
raw data:
pg_selinux_res
select * from (select set,dbsize,clients,avg(tps) avg_tps, round (100*( 1-lag ( avg(tps)) over ( order by dbsize,clients,set)/avg(tps)),1) diff_pct,scale from v1 group by set,dbsize,scale,clients order by dbsize,clients,set) t where t.set =4 order by scale,clients; set | dbsize | clients | avg_tps | diff_pct | scale -----+---------+---------+------------------------+----------+------- 4 | 1502 MB | 1 | 7002.7727490000000000 | 2.1 | 100 4 | 1502 MB | 2 | 13726.746474333333 | 0.8 | 100 4 | 1502 MB | 4 | 24392.296147000000 | 2.6 | 100 4 | 1502 MB | 8 | 24276.725237333333 | 2.3 | 100 4 | 1502 MB | 16 | 23974.144015000000 | 0.2 | 100 4 | 1502 MB | 32 | 25629.092840000000 | 0.5 | 100 4 | 5988 MB | 1 | 2633.2450016666666667 | 4.2 | 400 4 | 5988 MB | 2 | 4668.1277356666666667 | 15.8 | 400 4 | 5988 MB | 4 | 7622.5932590000000000 | 14.1 | 400 4 | 5988 MB | 8 | 9906.9333880000000000 | 8.7 | 400 4 | 5988 MB | 16 | 12596.0858780000000000 | 20.4 | 400 4 | 5988 MB | 32 | 13229.7484046666666667 | 18.1 | 400 4 | 10 GB | 1 | 2073.9020166666666667 | 1.8 | 700 4 | 10 GB | 2 | 3829.0723596666666667 | 7.8 | 700 4 | 10 GB | 4 | 6281.3118036666666667 | 7.2 | 700 4 | 10 GB | 8 | 8431.4767026666666667 | 8.0 | 700 4 | 10 GB | 16 | 11576.7615346666666667 | 19.2 | 700 4 | 10 GB | 32 | 13192.6005800000000000 | 20.4 | 700 4 | 15 GB | 1 | 1586.9348243333333333 | -9.0 | 1000 4 | 15 GB | 2 | 3034.7334050000000000 | -2.6 | 1000 4 | 15 GB | 4 | 5172.9388216666666667 | -7.6 | 1000 4 | 15 GB | 8 | 7585.5694350000000000 | -0.7 | 1000 4 | 15 GB | 16 | 10037.6583543333333333 | 5.3 | 1000 4 | 15 GB | 32 | 11943.1506076666666667 | 16.1 | 1000
So, for better results selinux should be disabled