summaryrefslogtreecommitdiffstats
path: root/src/server/globals.h
Commit message (Collapse)AuthorAgeFilesLines
* [SERVER] Use atomic vars for uplink byte countersSimon Rettberg2018-08-131-2/+1Star
|
* [SERVER] Use atomic var for (total)bytesSent countersSimon Rettberg2018-08-081-7/+5Star
| | | | | | Gets rid of the lastBytesSent field as well as the stats lock per client. Cleaned and split up the messy net_clientsToJson function while at it.
* [SERVER] Reload server config on SIGHUPSimon Rettberg2018-07-101-19/+20
| | | | | | | Most config settings can now be changed at runtime using SIGHUP. This currently excludes the basePath, listenPort, and the client and image count limits, as well as vmdkLegacyMode.
* [SERVER] Introduce backgroundReplication=hashblockSimon Rettberg2018-07-091-1/+5
| | | | | | | | This is a compromise; if you want to validate replicated data fairly quickly, using this option will make background replication only kick in when there's a "dirty" 16M block, i.e. some blocks within a 16M block are cached locally, but not all. Completing the block makes it possible to validate its CRC32 checksum.
* [SERVER] Refactor uplink/cache handling, improve crc checkingSimon Rettberg2018-07-041-2/+3
| | | | | | | | | | | | | 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.
* [SERVER] Add bgrMinClients: Thresold to control when BGR startsSimon Rettberg2018-04-121-0/+5
| | | | | Background replication will not kick in if there aren't at least that many clients connected.
* [SERVER] Experimental support for sparse files in proxy modeSimon Rettberg2018-03-151-0/+14
| | | | | | | | | | | | 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.
* [SERVER] Add multiple config options for limiting stuffSimon Rettberg2017-11-081-0/+29
| | | | | maxClients, maxImages, maxPayload, maxReplicationSize Refs #3231
* [SERVER] Support finer control over replication when a proxy connects to a proxySimon Rettberg2017-11-021-0/+7
| | | | | | | Introduce new flag in "select image" message to tell the uplink server whether we have background replication enabled or not. Also reject a connecting proxy if the connecting proxy uses BGR but we don't, as this would basically force the image to be replicated locally too.
* [SERVER] Improve handling of byte stats countersSimon Rettberg2017-10-251-3/+4
| | | | Less writes to variables, more up-to-date values for uplinks.
* [SERVER] Fix types or add explicit casts everywhere we might have type ↵Simon Rettberg2017-10-241-4/+4
| | | | conversion problems
* [SERVER] Use monotonic clock for measuring timeSimon Rettberg2017-10-191-5/+9
| | | | | Introduces new shared source unit timing.[ch] Closes #3214
* [SERVER] Try to connect to different server if proxy cycle is detectedSimon Rettberg2017-10-171-0/+1
|
* [*] Support hop-counting in request header, protocol version 3Simon Rettberg2017-10-171-3/+6
| | | | | | | | | | | | | | We steal 8 bits from the request offset to count hops when requests get relayed by proxies. This still leaves plenty of bits for the offset (56 bits, supporting images of up to 72 petabytes). This is used to detect proxy cycles. The algorithm is not perfect but should prevent endless relays of the same request. This is backwards compatible to old clients and servers, as the server only ever sets the hopcount in relayed requests if the upstream server is using protocol version 3 or newer, and clients are automatically upwards compatible as there is practically no image larger than 74PB, so the newly introduced hop count field is always 0 even in requests from old clients.
* [SERVER] Implement HTTP RPC that supports different queries and ACLSimon Rettberg2017-10-011-15/+5Star
| | | | | | | | | - ACL is defined in new file rpc.acl - Queries are still WIP, for now something like /query?q=stats&q=images /query?q=clients works, although the parsing is still ugly - Also supports HTTP keep-alive
* [*] Continue splitting #defines to clientconfig.h etc.Simon Rettberg2017-09-021-1/+1
|
* [SERVER] Split server-only defs from config.h to serverconfig.hSimon Rettberg2017-08-261-0/+7
|
* [SHARED] signal.h -> fdsignal.hSimon Rettberg2016-02-101-1/+1
|
* First steps in make signals more abstract from the underlying mechanism; ↵Simon Rettberg2016-02-051-1/+2
| | | | | | | | | | replace epoll with poll. We now don't assume that a signal equals a single fd (eventfd on Linux). The next step would be to create a version of signal.c that uses a pipe internally, so it can be used on other platforms, like *BSD. This is also the reason epoll was replaced with poll in uplink.c
* [SERVER] BREAKING: Get rid of pseudo case-insensitivityv2.1Simon Rettberg2016-02-011-3/+3
| | | | | | | | | | This was a wrong decision made long time ago, and it's broken in certain scenarios (eg. two servers serving from same NFS mount). Also it's of limited use anyways since it only supportes ASCII and would ignore umlauts, so blöd and BLÖD would still be considered two different images. So if you relied on this "feature" in any way, be careful when updating.
* [SERVER] Fix a lot of (mostly harmless) data racesSimon Rettberg2016-01-111-0/+1
|
* [SERVER] Performance: Optimized some functions (gprof)Simon Rettberg2015-12-171-6/+9
| | | | | | | 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.
* [SERVER] More fine grained locking for RPC; better error loggingSimon Rettberg2015-12-161-4/+8
|
* [SERVER] Remove non-working images from list, plus refactoringSimon Rettberg2015-12-151-0/+6
| | | | | | | | | | Now that we can automatically load unknown images from disk on request, it makes sense to remove non-working images from the image list. On future requests, we will look for them on disk again, which is nice in case of temporary storage hickups. Also, some more ore less related locking has been refined (loading images, replicating images)
* [SERVER] Make listen port configurableSimon Rettberg2015-12-141-2/+7
|
* [SERVER] Nullpad images virtually at runtime instead of padding the actual fileSimon Rettberg2015-12-101-1/+2
|
* [SERVER] Add image ID for easier handling in RPC, export RID via RPC, make ↵Simon Rettberg2015-05-081-0/+1
| | | | names of the byte count fields in RPC consistent
* [SERVER] Added counters for received and sent bytes.Stephan Schwaer2015-04-271-0/+2
|
* Get rid of unneccessary volatileSimon Rettberg2015-02-221-11/+11
| | | | Some minor debugging code, mostly commented out
* [SERVER] Use shared file handle for readingSimon Rettberg2015-01-301-0/+1
|
* [SERVER] Fix automatic proxying to use supplied connection; fix race ↵Simon Rettberg2015-01-271-1/+1
| | | | condition in uplink_init
* [SERVER] Crank up warning levels of gcc and fix them all (mostly sign ↵Simon Rettberg2015-01-141-1/+1
| | | | | | | compare and some unused params) Also allow newline at end of alt-servers file without complaining about it not being a valid alt server definition.
* [SERVER] Get rid of epoll in alservers.c, make valgrind+gdb happy by ↵Simon Rettberg2015-01-061-1/+1
| | | | handling signals even though we block them
* [SERVER] Use a thread pool for client connectionsSimon Rettberg2015-01-051-2/+0Star
|
* [SERVER] Use stdbool.h for booleans; minor refactoring of variable and ↵Simon Rettberg2014-12-311-11/+13
| | | | function names
* [SERVER] Add setting to enable/disable background replication, add comments ↵Simon Rettberg2014-12-291-0/+6
| | | | to config and code
* [SERVER] Improve replication and reconnecting behaviourSimon Rettberg2014-12-221-1/+1
|
* [SERVER] Configurable client timeout, adaptive replication speed (to be ↵Simon Rettberg2014-12-221-2/+8
| | | | tested against varying bw/latency), retry sendfile call if ret <= len
* Improve uplink handling, add code to debug thread creation/destruction, ↵Simon Rettberg2014-06-161-5/+5
| | | | change stupid convention of freeDiskSpace returning 0 on error, which is ambiguous to the disk simply being full...
* [SERVER] Automatic replication of images that are not complete on proxy. ↵Simon Rettberg2013-11-131-0/+2
| | | | Speed probably needs tweaking for different link speeds etc.
* [SERVER] Increase RTT check delay for uplinks that failed too many times to ↵Simon Rettberg2013-11-131-0/+1
| | | | save network bandwidth
* Merge branch 'simon' of dnbd3:dnbd3 into simonSimon Rettberg2013-11-121-0/+5
|\ | | | | | | | | Conflicts: src/server/altservers.c
| * [SERVER] Minor tweaks here and thereSimon Rettberg2013-11-101-0/+5
| |
* | [SERVER] Add "client only" flag for alt serversSimon Rettberg2013-11-121-1/+1
|/
* aesfsrgdsrSimon Rettberg2013-11-071-0/+5
|
* [SERVER] More debugging, more safety checks, disable alt servers that fail ↵Simon Rettberg2013-09-161-1/+2
| | | | too often
* [SERVER] Copy CRC-32 list from uplink server if availableSimon Rettberg2013-08-281-2/+12
| | | | | Split up helper.c, move file/disk related functions to fileutil.c Uplink: Make sure relayed requests are at least 1MiB
* [SERVER] Improve proxy mode, implement integrity check in proxy modeSimon Rettberg2013-08-121-0/+1
|
* I'm stupidSimon Rettberg2013-08-051-1/+1
|
* [SERVER] Fix use-after-free, improve cleanupSimon Rettberg2013-08-021-1/+1
|