I should to update my openssl to see real error? How can i do that if i use ubuntu 18.04?
I am not sure what causes the problem, but some hints anyway:
max_connections =10000
seems very high to me. In case you really have so many clients, consider using a connection pooler.
I would agree 10k connection seems excessive and the resource allocation doesn’t backup the use of that many connections. I would assume lots of database stalls and memory contention for the shared buffer pool with only 4GB and anything approaching even a few thousand connections let alone 10k.