| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Still needs some cleanup and optimizations, variable naming sucks,
comments, etc.
|
|
|
|
|
|
| |
- Now uses linked lists instead of huge array
- Does prefetch data on client requests
- Can have multiple replication requests in-flight
|
|
|
|
|
|
|
|
|
| |
Cache maps will now be saved periodically, but only if either they have
a "dirty" bit set, which happens if any bits in the map get cleared
again (due to corruption), or if new data has been replicated from an
uplink server. This either means at least one byte received and 5
minutes have passed, or at least 500MB have been downloaded. The timer
currently runs every 20 seconds.
|
| |
|
| |
|
|
|
|
|
|
| |
Gets rid of a bunch of locking, especially the hot path in net.c where
clients are requesting data. Many clients unsing the same incomplete
image previously created a bottleneck here.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The cacheFd is now moved to the uplink data structure and will
only be handled by the uplink thread.
The integrity checker now supports checking all blocks of an
image. This will be triggered automatically whenever a check for
a single block failed.
Also, if a crc check on startup fails, the image won't be discarded
anymore, but rather a full check will be initiated.
Furthermore, when calling image_updateCacheMap() on an image that
was previously complete, the cache map will now be re-initialized,
and a new uplink connection created.
|
|
|
|
|
|
|
| |
In scenarios where the proxy is using an NFS server as
storage (for whatever crazy reason) or when the cacheFd
goes bad through e.g. a switchroot, try to re-open it
instead of just disabling caching forever.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Will not preallocate images in this mode. Old images are only
deleted if the disk is full, determined by write() calls to
the cache file yielding ENOSPC or EDQUOT. In such a case,
the least recently used image(s) will be deleted to free
up at least 256MiB, and then the write() call will be repeated.
This *should* work somewhat reliably unless the cache partition
is ridiculously small. Performance might suffer a little, and
disk fragmentation might occur much faster than in prealloc
mode. Testing is needed.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This will close the readFd of images that have no active clients
after some idle period (1 hour currently).
Prevents deleted images from taking up space until the server
is shut down.
|
| |
|
| |
|
|
|
|
|
|
|
| |
A run with gprof revealed that background replication is a huge CPU hog.
The block selection was very slow and has been improved a lot.
Minor improvements were made to other functions that scan the cache map
of an image and are thus relatively slow.
|
| |
|
|
|
|
|
|
|
| |
The server used to reload all images on the main thread, which is
also responsible for accepting connections. While reloading the list,
no new connections were accepted, which lead to clients marking the
server as bad during their RTT measurements, then switching away from it.
|
| |
|
| |
|
|
|
|
| |
condition in uplink_init
|
| |
|
|
|
|
| |
function names
|
|
|
|
| |
change stupid convention of freeDiskSpace returning 0 on error, which is ambiguous to the disk simply being full...
|
| |
|
|
|
|
| |
too often
|
| |
|
| |
|
| |
|
|
|
|
| |
corruption
|
|
|
|
| |
empty cache map (so it needs an uplink server)
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|