# mysqli_connect Operation not permitted.



## glb_ussr (Apr 11, 2013)

Hi. I have two servers on FreeBSD 9.1. Ngninx + PHP + memcached + php-fpm on the first, MySQL on second.

Average users activity is 7000-10000 connections simultaneously. On this load I see this 
	
	



```
mysqli_connect(): (HY000/2002): Operation not permitted
```
 error, and more other users cannot connect to web site.

This tuning is on the web server:

```
kern.ipc.somaxconn=32768
net.inet.icmp.drop_redirect=1
#net.inet.icmp.log_redirect=1
net.inet.tcp.blackhole=1
net.inet.udp.blackhole=1
net.inet.tcp.drop_synfin=1
net.inet.tcp.sendspace=131072
net.inet.tcp.recvspace=65536
net.inet.udp.recvspace=32768
kern.fallback_elf_brand=-1
net.inet.ip.maxfragpackets=1024
kern.sync_on_panic=1
vfs.ufs.dirhash_maxmem=100000000
#kern.polling.burst_max=1000
#kern.polling.each_burst=1000
#kern.polling.reg_frac=100
#kern.polling.user_frac=1
kern.maxvnodes=256000
net.inet.ip.intr_queue_maxlen=256
net.inet.tcp.recvbuf_auto=0
net.inet.tcp.sendbuf_auto=0
net.inet.tcp.tso=0
#net.isr.direct=1
net.route.netisr_maxqlen=1024
#net.inet.flowtable.nmbflows=8192
kern.ipc.nmbclusters=65536
net.inet.ip.portrange.first=1024
net.inet.ip.portrange.hifirst=1024
net.inet.tcp.hostcache.expire=1200
net.inet.tcp.fast_finwait2_recycle=1
net.inet.tcp.finwait2_timeout=3000
net.inet.tcp.keepinit=5000
net.inet.tcp.nolocaltimewait=1
net.inet.tcp.maxtcptw=65536
net.inet.tcp.msl=3000
kern.coredump=0
kern.random.sys.harvest.interrupt=0
kern.random.sys.harvest.ethernet=0
net.inet.ip.fastforwarding=1
kern.maxfiles=65000
kern.maxfilesperproc=32000
net.inet.ip.intr_queue_maxlen=1000
kern.ipc.maxsockbuf=1048576
kern.coredump=0
vm.pmap.pv_entry_max=12000000
net.inet.icmp.icmplim=32000
net.inet.tcp.syncache.hashsize=32768
net.inet.tcp.syncache.bucketlimit=32
net.inet.tcp.syncache.cachelimit=1048576
kern.ipc.nmbclusters="128000"
```

But no effects.

How can I catch this error?


----------

