diff --git a/slsDetectorSoftware/MySocketTCP/genericSocket.h b/slsDetectorSoftware/MySocketTCP/genericSocket.h index aa6a75ab0..fc5e6e791 100644 --- a/slsDetectorSoftware/MySocketTCP/genericSocket.h +++ b/slsDetectorSoftware/MySocketTCP/genericSocket.h @@ -221,9 +221,9 @@ enum communicationProtocol{ val = SOCKET_BUFFER_SIZE; if((p == UDP) && (setsockopt(socketDescriptor, SOL_SOCKET, SO_RCVBUF, &val, sizeof(int)) == -1)) { - cerr << "Cannot set socket receive buffer size" << endl; - socketDescriptor=-1; - return; + cerr << "WARNING:Could not set socket receive buffer size" << endl; + //socketDescriptor=-1; + //return; } diff --git a/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp b/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp index aa7143973..c65c3dd4a 100644 --- a/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp +++ b/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp @@ -307,11 +307,11 @@ int slsReceiverFunctionList::startReceiver(char message[]){ if (pthread_setschedparam(listening_thread, policy, &listen_param) == EPERM) - cout << "ERROR: Could not prioritize threads. You need to be super user for that." << endl; + cout << "WARNING: Could not prioritize threads. You need to be super user for that." << endl; if (pthread_setschedparam(writing_thread, policy, &write_param) == EPERM) - cout << "ERROR: Could not prioritize threads. You need to be super user for that." << endl; + cout << "WARNING: Could not prioritize threads. You need to be super user for that." << endl; if (pthread_setschedparam(pthread_self(),5 , &tcp_param) == EPERM) - cout << "ERROR: Could not prioritize threads. You need to be super user for that." << endl; + cout << "WARNING: Could not prioritize threads. You need to be super user for that." << endl; //pthread_getschedparam(pthread_self(),&policy,&tcp_param); @@ -391,6 +391,20 @@ int slsReceiverFunctionList::startListening(){ // very end of the program. do { + //to increase socket receiver buffer size and max length of input queue by changing kernel settings + if(system("echo $((100*1024*1024)) > /proc/sys/net/core/rmem_max")) + cout << "\nWARNING: Could not change socket receiver buffer size in file /proc/sys/net/core/rmem_max" << endl; + else if(system("echo 250000 > /proc/sys/net/core/netdev_max_backlog")) + cout << "\nWARNING: Could not change max length of input queue in file /proc/sys/net/core/netdev_max_backlog" << endl; + + /** permanent setting heiner + net.core.rmem_max = 104857600 # 100MiB + net.core.netdev_max_backlog = 250000 + sysctl -p + // from the manual + sysctl -w net.core.rmem_max=16777216 + sysctl -w net.core.netdev_max_backlog=250000 + */ //creating udp socket if (strchr(eth,'.')!=NULL) strcpy(eth,"");