[PATCH] replace call to file(1) with libmagic
patrickdk at patrickdk.com
Wed Jul 23 02:46:06 CEST 2014
I threw this onto one of my servers to test, and it was working ok. I
went ahead and threw in onto 3 large production servers. So far no
issues. I'll follow up if I get some crashs or something.
Quoting Mark Martinec <Mark.Martinec+amavis at ijs.si>:
>> i did some research on optimizing Amavis/Spamassassin in our test setup
>> with NYTProf.
> Nice! NYTProf is a great profiling tool indeed.
>> I found that replacing the call to the external file(1) tool with
>> calls to File::LibMagic increased the throughput from 4.1 to 4.8 msg/s.
>> It also simplifies the code in determine_file_types().
> Thank you for the patch, accepted. Tried it out and it does work well.
> I'll probably keep both alternatives in the code, just in case,
> perhaps with automatic selection of File::LibMagic when available.
> Regarding past history of stability/vulnerability of the file(1)
> utility, I'm a little concerned as libmagic will run in the context
> of the same amavisd child process, instead of being a spawned process,
> so it has a capability of bringing down the process.
> I'll let it run for a while here and see how it behaves.
More information about the amavis-users