Hi Marcin,

On 4/10/19 1:02 PM, Marcin Deranek wrote:
> Hi Emeric,
> 
> Our process limit in QAT configuration is quite high (128) and I was able to 
> run 100+ openssl processes without a problem. According to Joel from Intel 
> problem is in cleanup code - presumably when HAProxy exits and frees up QAT 
> resources. Will try to see if I can get more debug information.

I've just take a look.

Engines deinit ar called:

haproxy/src/ssl_sock.c
#ifndef OPENSSL_NO_ENGINE
void ssl_free_engines(void) {
        struct ssl_engine_list *wl, *wlb;
        /* free up engine list */
        list_for_each_entry_safe(wl, wlb, &openssl_engines, list) {
                ENGINE_finish(wl->e);
                ENGINE_free(wl->e);
                LIST_DEL(&wl->list);
                free(wl);
        }
}
#endif
...
#ifndef OPENSSL_NO_ENGINE
        hap_register_post_deinit(ssl_free_engines);
#endif

I don't know how many haproxy processes you are running but if I describe the 
complete scenario of processes you may note that we reach a limit:

- the master sends a signal to older processes, those process will unbind and 
stop to accept new conns but continue to serve remaining sessions until the end.
- new processes are started and immediately and init the engine and accept 
newconns.
- When no more sessions remains on an old process, it calls the deinit function 
of the engine before exiting

So there is a time window where you have 2x the number of processes configured 
in haproxy using the engine.

I'm also supposed that old processes are stucked because there is some sessions 
which never ended, perhaps I'm wrong but a strace on an old process
could be interesting to know why those processes are stucked.

You can also use the 'master CLI' using '-S' and you could check if it remains 
sessions on those older processes (doc is available in management.txt)


Emeric

Reply via email to