OpenVZ Forum

Home » General » Support » numfile does not match with number of outputs from lsof
numfile does not match with number of outputs from lsof [message #21310] Thu, 04 October 2007 18:09 Go to next message
johnwu is currently offline  johnwu
Messages: 1
Registered: October 2007
Junior Member
I'm new to the openvz. Recently I came a cross a problem that the VPS exceed the numfile limit. According to the document, numfile means number of open file. So I ran a lsof command on the VPS it does not match with the value numfile in /proc/user_beancounters. Right now numfile shows 8000+ file being opened when lsof is showing only 800+ files? Am I missing something here?


Re: numfile does not match with number of outputs from lsof [message #21617 is a reply to message #21310] Fri, 12 October 2007 09:51 Go to previous message
khorenko is currently offline  khorenko
Messages: 533
Registered: January 2006
Location: Moscow, Russia
Senior Member
Hello John,

this is expected behavior: due to performance reason we've implemented the files precharging mechanism - at the very beginning a process is created having already 16 files accounted. If it opens a new file, only an internal counter increased (till it reaches 16), and the heavy operations on UBC (checking it and updating) is executed only when the process wants to open 17th file. At that moment next 16 files are precharged to the process (if there is a possibility to do this).
Yes, this makes the numfile UBC parameter less accurate, but makes open() call faster.

If you really unhappy with it and want to disable the precharging mechanism (and the performance decrease is ok for you), i can send you a patch, which will allow you to disable precharging. We've made it some time ago, guess that somebody might be unhappy, but still didn't have complains. Smile

If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
Previous Topic: *BUG REPORTED* Cannot get info for user quota file from kernel
Next Topic: Problems with online migration with 039 and the tun/tap patch
Goto Forum:

Current Time: Tue Dec 05 09:06:55 GMT 2023

Total time taken to generate the page: 0.01943 seconds