When I try to ulimit -n 4097 or greater I get the following error:
bash: ulimit: open files: cannot modify limit: Operation not permitted
None of the solutions at How do I increase the open files limit for a non-root user? seem to work or apply.
I can raise the limit to 4096 but not beyond.
Output of ulimit -n -H
4096
Edit:
Problem solved:
https://superuser.com/questions/1200539/cannot-increase-open-file-limit-past-4096-ubuntu