-2

I have a powerful server (32 cores, 128 GB RAM, MD Ryzen 9 7950X3D), and I installed Nginx.

I start load-testing it on a simple Health check using ab.

I notice that when I test it like this: ab -c 1000 -n 50000 -k "https://***.com/TestHealth"

I can reach 50k RPS, but when I test it like this:

ab -c 1000 -n 50000 "https://***.com/TestHealth"

I get only 2348 RPS.

The testing machine is a separate machine, the strongest I found (CPU-wise) on AWS.

Now I know that -k keeps keepAlive and this for sure helps with performance, but since the server was not heavily utilized on this load, I guess I can get much better results from it.

What are the best SSL and server settings I can do for this server? is there an organized process I can go through to make sure my server is optimized for the best possible performance for his HW and BW?

This is the results of vmstat 1 3 before the test:

procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0 111926384 373764 14628824    0    0     1     2    3    4  0  0 100  0  0
 0  0      0 111926384 373764 14628832    0    0     0     0  511  874  0  0 100  0  0
 0  0      0 111926384 373764 14628832    0    0     0     0  638 1072  0  0 100  0  0

This is the results during the test (without -k):

vmstat 1 3
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0 111884320 373852 14631856    0    0     1     2    3    4  0  0 100  0  0
 1  0      0 111882256 373852 14631996    0    0     0     0 35435 10614  2  1 97  0  0
 0  0      0 111882336 373860 14632032    0    0     0    38 38040 11449  2  2 96  0  0

This is the results during the test with -k:

vmstat 1 3
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 2  0      0 111862632 374048 14696080    0    0     1     2    4    4  0  0 100  0  0
 2  0      0 111860968 374048 14699616    0    0     0     0 100300 66310  1  3 96  0  0
 0  0      0 111859408 374048 14703228    0    0     0     0 100014 66075  1  3 95  0  0

Changin value worker_processes to 24: During -k test:

vmstat 1 3
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 1  0      0 112021120 374312 14761548    0    0     1     2    4    4  0  0 100  0  0
 2  0      0 112023288 374312 14765152    0    0     0     0 102319 66892  1  2 97  0  0
 0  0      0 112022048 374316 14768552    0    0     0    29 103237 67227  1  2 97  0  0

without:

vmstat 1 3
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0 111983120 374328 14781508    0    0     1     2    4    4  0  0 100  0  0
 6  0      0 111982048 374328 14781644    0    0     0     0 36247 10694  2  1 97  0  0
 1  0      0 111980312 374328 14781788    0    0     0     0 34453 10596  1  1 97  0  0
0xPwn
  • 97

1 Answers1

0

As mentioned by Gerald Schneider the wise way is to change one parameter then test, analyse, repeat. Let me point you to some changes you can try:

  • Change/add worker_processes to be fixed value, less than number of cores (to give some place for the OS). Not use if your processor support something like hyperthreads, if yes, set worker_processes to be total number of hyperthreads - 4 (for example).
  • add in location aio threads

`

location /TestHealth  
    {      
        return 200 "hello";     
       aio threads;  
       } 

`

Romeo Ninov
  • 6,677