Too many open files issue

Anisha Vishnoi 7 years ago

Hi Anton,
I am facing below mentioned issue in Traccar3.17-
I have applied optimizations which you have suggested in documnets.

FINEST|1286/0|Service traccar|18-09-22 18:53:15|Sep 22, 2018 6:53:15 PM org.jboss.netty.channel.socket.nio.AbstractNioSelector
FINEST|1286/0|Service traccar|18-09-22 18:53:15|WARNING: Failed to accept a connection.
FINEST|1286/0|Service traccar|18-09-22 18:53:15|java.io.IOException: Too many open files
FINEST|1286/0|Service traccar|18-09-22 18:53:15|	at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
FINEST|1286/0|Service traccar|18-09-22 18:53:15|	at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:250)
FINEST|1286/0|Service traccar|18-09-22 18:53:15|	at org.jboss.netty.channel.socket.nio.NioServerBoss.process(NioServerBoss.java:100)
FINEST|1286/0|Service traccar|18-09-22 18:53:15|	at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
FINEST|1286/0|Service traccar|18-09-22 18:53:15|	at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42)
FINEST|1286/0|Service traccar|18-09-22 18:53:15|	at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
FINEST|1286/0|Service traccar|18-09-22 18:53:15|	at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
FINEST|1286/0|Service traccar|18-09-22 18:53:15|	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
FINEST|1286/0|Service traccar|18-09-22 18:53:15|	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
FINEST|1286/0|Service traccar|18-09-22 18:53:15|	at java.lang.Thread.run(Thread.java:745)
FINEST|1286/0|Service traccar|18-09-22 18:53:15|
Anisha Vishnoi 7 years ago

When I check for Traccar process it will show below mentioned limits-

cat /proc/2773/limits

Max open files 150000 150000 files

Anton Tananaev 7 years ago

Are you sure it's the right process? How many connections do you have?

Anisha Vishnoi 7 years ago

Hi

I have followed below mentioned steps-

  1. cat /run/wrapper.traccar.pid
  2. output is - 7105
  3. cat /proc/7105/limits
  4. output is below
Max open files            150000               150000               files
Max processes             63794                63794                processes

I have 350+ devices and connections are -

 netstat -ant | awk '{print $6}' | sort | uniq -c | sort -n
      1 established)
      1 Foreign
      3 LAST_ACK
      5 SYN_RECV
     41 FIN_WAIT1
     50 TIME_WAIT
    161 LISTEN
    520 ESTABLISHED

server configurations are-
RAM - 8GB
HD- 50GB

Anton Tananaev 7 years ago

Is that wrapper limit or Traccar limit?

Anisha Vishnoi 7 years ago

I have check with this pid and the result is the same-

INFO|wrapper|Service traccar|18-09-24 11:47:34|posix_spawn pid 8693
INFO|wrapper|Service traccar|18-09-24 11:47:34|started process 8693
INFO|wrapper|Service traccar|18-09-24 11:47:34|started process with pid 8693
Anton Tananaev 7 years ago

There are two processes. Which one are you talking about?

Anisha Vishnoi 7 years ago

with pid - 8693

Anton Tananaev 7 years ago

Is it wrapper or Traccar process? Number doesn't tell me anything.

Anisha Vishnoi 7 years ago

It is traccar process

Anton Tananaev 7 years ago

Then I'm not sure how it's possible. "Too many open files" error is coming from the operating system itself, so there must be some reason.

Anisha Vishnoi 7 years ago

ok. I am using ubuntu. Can you suggest best os for the production.

Anton Tananaev 7 years ago

Any Linux should be fine. You need to find out why it gives you this error.