Chen, Bin | 13 Jun 2012 20:40

RabbitMQ log rotation problem with large log file

Hi All,

 

We are running several RabbitMQ servers on Windows. The version is 2.7.1.

The servers have been running for several months. The log files are over 16 GB now.

We tried to rotate the log manually with rabbitmqctl.bat.

 

For some reason, only –sasl log file was rotated. The very large main log file was not.

If you know some way to solve this problem without shutting down the server, please let me know.

 

Thank you in advance,

 

Best regards,

--Bin Chen

 

 

<div><div class="WordSection1">
<p class="MsoNormal">Hi All,<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">We are running several RabbitMQ servers on Windows. The version is 2.7.1.<p></p></p>
<p class="MsoNormal">The servers have been running for several months. The log files are over 16 GB now.<p></p></p>
<p class="MsoNormal">We tried to rotate the log manually with rabbitmqctl.bat.<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">For some reason, only &ndash;sasl log file was rotated. The very large main log file was not.<p></p></p>
<p class="MsoNormal">If you know some way to solve this problem without shutting down the server, please let me know.<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Thank you in advance,<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">Best regards,<p></p></p>
<p class="MsoNormal">--Bin Chen<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
</div></div>
Emile Joubert | 14 Jun 2012 14:04
Favicon

Re: RabbitMQ log rotation problem with large log file


Hi,

On 13/06/12 19:40, Chen, Bin wrote:
> The servers have been running for several months. The log files are over
> 16 GB now.

I've observed that the broker consumes RAM according to the size of the
logfile during rotation, so it seems likely that the logfile is read
into memory in its entirety. I will file a bug to reduce the memory
requirements during log rotation, but in the meantime you will need to
rotate logs often enough that they fit in available RAM.

> If you know some way to solve this problem without shutting down the
> server, please let me know.

It might be possible by turning logging off and back on using the
underlying error_logger
(http://www.erlang.org/doc/man/error_logger.html) and the "rabbitmqctl
eval" command, but this is unsupported and you risk losing messages
generated during the procedure. I recommend instead that you shut down
the broker.

-Emile


Gmane