I'm using unoconv or libreoffice to convert documents,
starting unoconv --listener
It seems the answer was simple...
In processlist I can see:
root 4197 1.1 0.2 1112580 66436 pts/2 Sl+ 20:20 0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002;urp;StarOffice.ComponentContext
It seems that LibreOffice is using IP and port for some internal communications, so I turned off the firewall (iptables) and it worked fine - from 20 seconds to 1 second!!
At the end I found, that IP6 can not be blocked on firewall for local connections, and that's what was causing the problem.
After I add this rule to
iptables.v6 configuration file, everything is working fine:
ip6tables -A INPUT -i lo -j ACCEPT