+
+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 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);