I have solved this problem.
In config.php you find this lines:
$CFG->dboptions = array(
'dbpersist' => false, // should persistent database connections be
// used? set to 'false' for the most stable
// setting, 'true' can improve performance
// sometimes
This was set to 'dbpersist' => true and so I have got never endig processes.