workerman icon indicating copy to clipboard operation
workerman copied to clipboard

reduced speed when running a server with openresty

Open MrSipping opened this issue 2 years ago • 4 comments

Hi, doing direct benchmarks on the machine with Mark the speed is remarkable, but if I pass my connection through an api gateway with openresty doing the benchmark the speed drops a lot and I would like to understand how to improve it.

MrSipping avatar Dec 29 '22 11:12 MrSipping

Show your Nginx config, that creates openresty.

joanhey avatar Dec 29 '22 23:12 joanhey

Show your Nginx config, that creates openresty.

user www-data; worker_processes 2;

#error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info;

pid /run/openresty.pid;

events { worker_connections 4096; }

http { include mime.types; default_type application/octet-stream;

#access_log logs/access.log main;

sendfile on; #tcp_nopush on;

#keepalive_timeout 0; keepalive_timeout 75;

gzip off;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE ssl_prefer_server_ciphers on;

include ../sites/*; }

MrSipping avatar Dec 30 '22 09:12 MrSipping

can someone help?

MrSipping avatar Jan 05 '23 11:01 MrSipping

First, you need to say how do you benchmark it. If you are using ab, it's only http 1.0, and create a new connection each time. With this config, each connection need to check the TLS, and will be very slow.

This config have:

worker_processes 2;
...
worker_connections 4096;

So the maximum concurrent connections will be: 2 x 4096

It's also very important that you show the config in /sites/, that make the proxy_pass to Workerman.

joanhey avatar Jan 05 '23 12:01 joanhey