sslproxy_session = "info"
sslproxy_connection = "info"
-[virtualservice]
-nic_realserver_side = "eth0"
-session_thread_pool_size = 256
-throughput_calc_interval = 500
-
#
# l7vsadm setting
#
con_interval = 1
con_count = 10
+#
+# l7vsd setting
+#
+[l7vsd]
+maxfileno = 65535
+
+#
+# virtualservice setting
+#
+[virtualservice]
+nic_realserver_side = "eth0"
+session_thread_pool_size = 256
+throughput_calc_interval = 500
#
# l7vsd replication setting
#include <pthread.h>
#include <stdlib.h>
#include <errno.h>
+#include <sys/time.h>
+#include <sys/resource.h>
#include <boost/shared_ptr.hpp>
#include "l7vsd.h"
}
}
+ //set max file open num
+ Parameter param;
+ error_code err;
+ int maxfileno = param.get_int(PARAM_COMP_L7VSD, "maxfileno", err);
+ if( err ){
+ logger.putLogWarn( LOG_CAT_L7VSD_MAINTHREAD, 1, "maxfileno parameter not found.", __FILE__, __LINE__ );
+ maxfileno = 1024;
+ }
+
+ struct rlimit lim;
+ lim.rlim_cur = maxfileno;
+ lim.rlim_max = maxfileno;
+ int ret;
+ ret = setrlimit( RLIMIT_NOFILE, &lim );
+ if( 0 != ret ){
+ std::stringstream buf;
+ buf << "setrlimit failed:" << errno;
+ logger.putLogWarn( LOG_CAT_L7VSD_MAINTHREAD, 1, buf.str(), __FILE__, __LINE__ );
+ }
+
// signal handler thread start
boost::thread sigthread( boost::bind( &l7vsd::sig_exit_handler, this ) );
sigthread.detach();