Do at runtime
sysctl kern.maxfiles=10240
Burn it to the system:
Add a line kern.maxfiles=102400 to /etc/sysctl.conf.
Then tune /etc/login.conf:
Modify openfiles-max and openfiles-cur like
openfiles-max=102400
openfiles-cur=102400
Restart your process.