Modify

Opened 8 years ago

Last modified 7 years ago

#997 confirmed enhancement

transmission - preallocation full by default installation

Reported by: mihaly.reg@… Owned by:
Priority: normal Milestone: Firmware 2.3
Component: fon-plugin-transmission Version: 2.3.6.1 (Gari jr.)
Severity: unknown
Cc: Hardware: 2.0n (FON2300)

Description

Installing transmission on fonera brings the following setting in settings.json: "preallocation": 0, that means 'no preallocation', in other words when a download is added it will create the data files 'on the go', as soon as each file is downloaded. That's bad because after a while the disk will be very fragmented. Change request: by default install transmission with: "preallocation": 2, that mean 'full allocation at torrent add', this setting will prevent the fragmentation of disk. Thanks!

Attachments (0)

Change History (3)

comment:1 in reply to: ↑ description Changed 8 years ago by matthijs

  • Milestone set to Firmware 2.3
  • Status changed from new to confirmed

Looking at this setting a bit, it turns out there are three settings:

0 - None - No preallocation, just let the file grow whenever a new packet comes in 1 - Sparse - Preallocate by writing just the final block in the file 2 - Full - Preallocate by writing zeroes to the entire file

Note that if fallocate64 is available (which isn't the case on a Fonera / uclibc it seems), then Sparse and Full will both use it (and thus be identical). If posix_fallocate is available, Full preallocatoin will use that (but not Sparse).

I've done a quick test with Full preallocation, which seems to work. However, it also seems that the webgui completely locks up while preallocation is happening. I'm not sure why this happens, since Transmission does use multiple threads for its work. I didn't dive into Transmission's threading model yet, but I do consider this a problem. Perhaps this same problem can cause delays and lockups in the Transmission interface at other times (when a big part of a file needs te be allocated on the fly when preallocation is disabled).

Because of this issue, I'll not change the default configuration just yet: This needs more investigation first (but I don't want to delay the 2.3.7.0 release because of this).

We'll also need to do some testing to see what the effects of this setting on the performance will be. Doing full preallocation means doing more work when a torrent is added, but might mean less work later on.

comment:2 Changed 8 years ago by mihaly.reg@…

if the 'sparse' mode will also prevent fragmentation then it would be a better option. Writing zeroes is not really necessary I think. If I understood correctly: 'sparse' will write the last block and reserve the space on the disk between the first and last block ?

comment:3 Changed 8 years ago by matthijs

I think I remember that "Sparse" allocation is a bit filesystem dependent: FAT can't handle sparse files, so doing sparse allocation results in the filesystem driver writing those zeros. Ext2 can handle sparse files, so just the final block will be allocated (which still makes it susceptible to fragmentation, I think). Ideally, we would use fallocate64, but I don't think uclibc supports this.

Btw, note that 'sparse' preallocation is already the default setting AFAICS, so setting it to 1 / sparse explicitely won't be helping anything...

Add Comment

Modify Ticket

Action
as confirmed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.