Boost C++ Libraries: Ticket #12398: Boost log writes much less records in remote disk than local disk https://svn.boost.org/trac10/ticket/12398 <p> Using Boost.log, my application tries to write a large number of records (600 MB) into the file in either a local disk or a remote/network disk. I tested twice, but the remote disk got much less records. </p> <p> I use text_file_backend as the backend. Both test finished in 8 minutes. Then the throughput is 600MB/8/60sec = 1.25M/sec. The file in local disk has almost 600 MB. But the file in remote disk is only 200 MB. My application is on Windows, so the file path on remote disk is like "<br /><a class="missing wiki">MyFileServer</a>\log\20160817-120329.log". The remote disk is shared by many users, so it may be slow. After the test, I still saw new records written to the remote file. Seems the network is not blocked. </p> <p> That is strange. Could boost log handle remote disk? How to find out the root cause? Install exception handler? Thank you. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12398 Trac 1.4.3 Andrey Semashev Wed, 17 Aug 2016 22:01:55 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12398#comment:1 https://svn.boost.org/trac10/ticket/12398#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> Boost.Log has no knowledge about the nature of the filesystem, it works the same regardless. If your sinks are asynchronous then make sure log records are not piling up in the queue or being dropped due to the queue capacity limit. Try switching to synchronous logging or a non-dropping queueing policy and make sure you flush the sink before the application exit. Also check that you're using the same filter in both cases. </p> Ticket xinyan.zhang@… Thu, 18 Aug 2016 19:07:56 GMT <link>https://svn.boost.org/trac10/ticket/12398#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12398#comment:2</guid> <description> <p> My code uses asynchronous sink without setting any queuing policy. Does that mean "unbounded_fifo_queue" is used by default? And the queue has unlimited depth? If so, it could grow to whatever within the memory size. In my machine the maximum memory usage is less than 70%. The application itself uses about 800 MB memory. I did see any memory over flow. </p> </description> <category>Ticket</category> </item> <item> <author>xinyan.zhang@…</author> <pubDate>Fri, 19 Aug 2016 21:24:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12398#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12398#comment:3</guid> <description> <p> Sorry, the last sentence in previous reply should be " I did <strong>NOT</strong> see any memory over flow. " </p> <p> Is there any way to check if messages are dropped or not? My way is: I added a counter, every time it increased by +1 when writing a log record. Then after the test, I waited for 20 minutes to ensure log records were written into the file. And then shut down the application. I found last counter is 10,000 larger than the total line number. In other words, almost 10,000 lines of record are missing in the log file. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Sat, 20 Aug 2016 00:36:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12398#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12398#comment:4</guid> <description> <blockquote class="citation"> <p> Is there any way to check if messages are dropped or not? </p> </blockquote> <p> There is not. Unless there is a bug or memory overflow, <code>unbounded_fifo_queue</code> should not drop records. You'll have to debug the problem yourself. I'd start by counting the number of log records that passed the filter (<code>asynchronous_sink::consume</code>) and also the number of records that reached the file stream (<code>text_file_backend::consume</code>). Also try switching to <code>synchronous_sink</code>. </p> </description> <category>Ticket</category> </item> <item> <author>xinyan.zhang@…</author> <pubDate>Thu, 25 Aug 2016 21:06:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12398#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12398#comment:5</guid> <description> <p> I found the reason why less log records are in file. It is not related to the boost library, but our test tool which has problems. So, less log records are generated. Thank you very much. </p> </description> <category>Ticket</category> </item> </channel> </rss>