Commits

Mark Salyzyn  committed 581edc1

set /proc/sys/net/unix/max_dgram_qlen to large value

- init: set /proc/sys/net/unix/max_dgram_qlen to 300
- libsysutils: Add listen backlog argument to startListener
- logd: set listen backlog to 300

Change-Id: Id6d37d6c937ba2d221e76258d89c9516619caeec

  • Participants
  • Parent commits ba23d53

Comments (0)

Files changed (4)

File include/sysutils/SocketListener.h

 
     virtual ~SocketListener();
     int startListener();
+    int startListener(int backlog);
     int stopListener();
 
     void sendBroadcast(int code, const char *msg, bool addErrno);

File libsysutils/src/SocketListener.cpp

 }
 
 int SocketListener::startListener() {
+    return startListener(4);
+}
+
+int SocketListener::startListener(int backlog) {
 
     if (!mSocketName && mSock == -1) {
         SLOGE("Failed to start unbound listener");
         SLOGV("got mSock = %d for %s", mSock, mSocketName);
     }
 
-    if (mListen && listen(mSock, 4) < 0) {
+    if (mListen && listen(mSock, backlog) < 0) {
         SLOGE("Unable to listen on socket (%s)", strerror(errno));
         return -1;
     } else if (!mListen)

File logd/main.cpp

     // and LogReader is notified to send updates to connected clients.
 
     LogListener *swl = new LogListener(logBuf, reader);
-    if (swl->startListener()) {
+    // Backlog and /proc/sys/net/unix/max_dgram_qlen set to large value
+    if (swl->startListener(300)) {
         exit(1);
     }
 

File rootdir/init.rc

     write /proc/sys/kernel/dmesg_restrict 1
     write /proc/sys/vm/mmap_min_addr 32768
     write /proc/sys/net/ipv4/ping_group_range "0 2147483647"
+    write /proc/sys/net/unix/max_dgram_qlen 300
     write /proc/sys/kernel/sched_rt_runtime_us 950000
     write /proc/sys/kernel/sched_rt_period_us 1000000