Too Many Open FIles

39 views
Skip to first unread message

radio...@gmail.com

unread,
Aug 2, 2020, 6:31:55 PM8/2/20
to weewx-development

After upgrading to Raspberry PI Buster – every three or four days, WeeWx (4.1.1) is failing with a “Too Many Open Files”.    

 

Anyone else seeing this?

 

Clay Jackson

cl...@n7qnm.net

 

Tom Keffer

unread,
Aug 2, 2020, 6:49:24 PM8/2/20
to Clay Jackson, weewx-development
No, I have not seen this. Here's how to find out what files weewx has open. First, get the process ID (PID):

ps aux | grep weewxd

This will give you an output something like:

tkeffer    16646 14.7  0.1  45100 25756 pts/0    D+   15:36   0:15 /home/tkeffer/.pyenv/versions/3.5.9/bin/python3 ./bin/weewxd
tkeffer    16701  0.0  0.0  17664   660 pts/1    S+   15:38   0:00 grep --color=auto weewxd

You want the first line. It will tell you that the PID is 16646.

Then use this to list the open files:

ls -l /proc/16646/fd

where you should substitute the PID for 16646.

You shouldn't find much more than the port for the weather station hardware, plus the archive database. Maybe a couple more files during report generation.

-tk


--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/093f01d6691c%24b8862c50%24299284f0%24%40gmail.com.

Tom Keffer

unread,
Aug 2, 2020, 6:51:27 PM8/2/20
to weewx-development
PS: you can get a more complete listing by using the lsof command:

lsof -p PID

where PID is the process ID you found. This will include shared libraries and fonts.

-tk

radio...@gmail.com

unread,
Aug 3, 2020, 12:52:58 AM8/3/20
to Tom Keffer, weewx-development

Thanks, Tom!   Lsof showed a HUGE number of “open” i2c connections.  Turns out, shortly AFTER my buster upgrade, I move my barometer routine (which reads an i2c device on the weewx server) from a separate cron job (writing to a file) directly into weewx; but the code I grabbed did not have an explicit “close” at the end.  

 

Lsof is stable now – time will tell!

Thanks again!

 

Clay

Reply all
Reply to author
Forward
0 new messages