I have some php code, that execute for a very long time.
I need to realise next scheme:
I don't want to use exec command because 1000 users makes 1000 php processes. It's not way for me...
So you basically want a queue (possibly stored in a database) and a command line script ran by cron that process queued items.
Clarification: I'm not sure about what's unclear about my answer, but this complies with the two requirements imposed by the question:
Use http requests to the local http server from within your script in combination with phps ignore_client_abort()
function.
That way you keep the load inside the http servers worker processes, have a natural limit and queuing of requests comes for free.