public function getMaxOpenFilesLimit()
    {
        static $limit = null;

        if (null === $limit) {
            $process = new Process('ulimit -n');
            $process->run();

            if ($process->isSuccessful()) {
                $limit = (int) trim($process->getOutput());
            }

            unset($process);
        }

        return $limit;
    }