New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WindowsMultiProcessFileAppender - FileSystemRights.AppendData #1756
WindowsMultiProcessFileAppender - FileSystemRights.AppendData #1756
Conversation
0144b18
to
7caaaf9
Compare
7caaaf9
to
1bf7eaa
Compare
I have tested the updated solution with the test-project from #1474 made by @AndreGleichner, and it completes and performs successful verification. |
Current coverage is 81% (diff: 82%)@@ master #1756 diff @@
==========================================
Files 276 277 +1
Lines 17523 17626 +103
Methods 2756 2767 +11
Messages 0 0
Branches 1975 1989 +14
==========================================
+ Hits 14089 14226 +137
+ Misses 2988 2947 -41
- Partials 446 453 +7
|
So it's untrue? Or unsure? |
Thanks for the changes! Will try to review it soon and release in into 4.4 (rc) |
1bf7eaa
to
adb503c
Compare
Have noticed that the unit test time has increased. Most likely because of the added combinations in FileTargetTests.cs (Linq-booleanValues). Not sure if this is a good direction, as every new parameter will double the time. |
Good to know. It was ~11min and now ~19. In my experience 11 was already to long. When working on several items, I have to wait for hours. Everything is tested with net35+net40+net45. Maybe we should test some tests only with net45 |
05f3f0c
to
15647f6
Compare
Added a filter so it only exercises the major FileAppenders-combinations. Though it just removed 1-2 minutes. Travis Test Count = 1770 (Before=2190), but still an increase from current master=1554 It seems the time is spend by the code-coverage, as the other builds completes quickly, so not sure if the skipping the FileTargetTest for the other builds will help that much. |
44b0297
to
a1f1330
Compare
…le windows handle
a1f1330
to
80e40da
Compare
Will try to test this next week |
Reviewed 1 of 20 files at r1, 23 of 24 files at r2. src/NLog/Internal/FileCharacteristicsHelper.cs, line 68 at r2 (raw file):
Is this not infecting performance? Comments from Reviewable |
Need docs for
|
src/NLog/Internal/FileCharacteristicsHelper.cs, line 68 at r2 (raw file): Previously, 304NotModified (Julian Verdurmen) wrote…> Is this not infecting performance?Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion. src/NLog/Internal/FileCharacteristicsHelper.cs, line 68 at r2 (raw file): Previously, snakefoot (Rolf Kristensen) wrote…> Changing the parameter from IntPtr to FileStream-reference ?Comments from Reviewable |
src/NLog/Internal/FileCharacteristicsHelper.cs, line 68 at r2 (raw file): Previously, 304NotModified (Julian Verdurmen) wrote…> Well using FileStream insteaf of IntPtrComments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion. src/NLog/Internal/FileCharacteristicsHelper.cs, line 68 at r2 (raw file): Previously, snakefoot (Rolf Kristensen) wrote…> I'm only using the FileStream-parameter to carry the IntPtr (If needed). If using Win32FileCharacteristicsHelper then it will use fileStream.SafeFileHandle.DangerousGetHandle()Comments from Reviewable |
from tests give me ~10% performance gain, also with 1 thread. tested with
|
Will be in news post |
Merged #1474 with master, and changed from native windows file handle to managed FileStream-object
Using FileSystemRights.AppendData (FILE_APPEND_DATA / O_APPEND) allows multiple processes to write to the same local file without needing a global mutex object. This improves file-write performance with a factor 2.
There are different rumors on the Internet whether FILE_APPEND_DATA works correctly when the number of bytes written in a single operation is larger than 1KByte or 4KByte. The file-size increase that allocates the needed room in the file is atomic. But writing the bytes to the allocated room is probably done in sector size depending on version of operating system. This means if having very aggressive tail application that performs direct file reads, then it can momentarily read the allocated room without data has actually been written.
This change is