Hello, On Mon, Jan 21, 2019 at 06:53:12AM +0300, Wert wrote: > Hi, > > I'm talking only about performance ways) > > About socket. > I use UDP for sending, there are no reasons for delays. > However, my bad - I misunderstood some FDs in "lsof". It is not related to > that UDP-sending, that is OK. > > About file system. > I open file from disk for GeoIP, but finally it cached in memory. I don't > think that there will be difference if I move it to ramdisk. > > Example for Redis (works same as for GeoIP): > 1) luarocks install redis-lua > 2) At the top in lua-file (or inside core.register_init()): > redisClient = pcall(redis.connect,'unix:///run/redis/redis.sock') > 3) For cfg just "lua-load" param should be enough. > > For each reload "lsof" would show one additional unix-socket on master and > worker. > > As I understand: > - The LUA initialization executes for master and creates FD. > - During reload "re-executed" master-process keeps old FD and gets one more > by new lua-init. > - Workers inherit everything from master.
To avoid FD leaks during a reload of the master process, those FDs must be marked FD_CLOEXEC. I don't know how you are opening these file but you should try to do a fcntl on the FD. -- William Lallemand