void bsd_srv_setup(int scale) { #if defined(__LP64__) /* if memory is more than 16G, then apply rules for processes */ if (scale > 0) { maxproc = 2500 * scale; hard_maxproc = maxproc; /* no fp usage */ maxprocperuid = (maxproc*3)/4; maxfiles = (150000 * scale); maxfilesperproc = maxfiles/2; desiredvnodes = maxfiles; vnodes_sized = 1; if (scale > 4) { /* clip them at 32G level */ somaxconn = 2048; /* 64G or more the hash size is 32k */ if (scale > 7) { /* clip at 64G level */ tcp_tcbhashsize = 16 *1024; max_cached_sock_count = 165000; } else { tcp_tcbhashsize = 32 *1024; max_cached_sock_count = 60000 + ((scale-1) * 15000); } } else { somaxconn = 512*scale; tcp_tcbhashsize = 4*1024*scale; max_cached_sock_count = 60000 + ((scale-1) * 15000); } } #endif bsd_exec_setup(scale); }
void bsd_scale_setup(int scale) { #if defined(__LP64__) if ((scale > 0) && (serverperfmode == 0)) { maxproc *= scale; maxprocperuid = (maxproc * 2) / 3; } /* Apply server scaling rules */ if ((scale > 0) && (serverperfmode !=0)) { maxproc = 2500 * scale; hard_maxproc = maxproc; /* no fp usage */ maxprocperuid = (maxproc*3)/4; maxfiles = (150000 * scale); maxfilesperproc = maxfiles/2; desiredvnodes = maxfiles; vnodes_sized = 1; if (scale > 4) { /* clip somaxconn at 32G level */ somaxconn = 2048; /* * For scale > 4 (> 32G), clip * tcp_tcbhashsize to 32K */ tcp_tcbhashsize = 32 *1024; if (scale > 7) { /* clip at 64G level */ max_cached_sock_count = 165000; } else { max_cached_sock_count = 60000 + ((scale-1) * 15000); } } else { somaxconn = 512*scale; tcp_tcbhashsize = 4*1024*scale; max_cached_sock_count = 60000 + ((scale-1) * 15000); } } #endif bsd_exec_setup(scale); }